linux - 获取 java.lang.noclassdeffounderror: org.springframework/amqp/core/corelation
问题描述
我的 spring_boot_version 是 '2.0.5.RELEASE',spring_version = '4.3.8.RELEASE' 并且我用于运行 rabbit mq 的 spring 依赖项是:
compile("org.springframework.boot:spring-boot-starter-websocket:$spring_boot_version") {
exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
}
compile "org.springframework.boot:spring-boot-starter-log4j2:$spring_boot_version"
compile("org.springframework.amqp:spring-rabbit:2.1.4.RELEASE") {
exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
}
compile "org.codehaus.jackson:jackson-mapper-asl:1.9.13"
compile "org.apache.logging.log4j:log4j-web:2.7"
该应用程序在我的本地机器上运行良好,但是在将 spring boot 服务器作为 linux 服务器上的 systemd 服务运行时出现此错误。如何在服务器级别解决这个问题?
解决方案
我会推荐org.springframework.boot:spring-boot-starter-amqp
over the,spring-rabbit
因为你使用的是spring boot。
您看到的错误可能是因为您还需要添加org.springframework.amqp:spring-amqp
。
推荐阅读
- mit-scratch - 如何在 Scratch 中模拟 While 循环?
- android - 膨胀类 android.support.v7.widget.CardView、recyclerView 和 SwipeRefreshLayout 时出错
- sqlite - 如何在 Listview 中恢复数据
- facebook-opengraph - Facebook 不显示 Open Graph 图片
- laravel - 当标签的名称在另一个表上时,如何在 laravel 图表中显示标签?
- react-native - 如何在胜利折线图 X 轴标签中换行或插入“换行”字符
- java - 是否可以用自定义注释替换 jpa 注释 @EntityListeners(SomeListener.class) ?
- javascript - 如何使用 AJAX 刷新 Django 页面的一部分?
- .net-core - Raspberry Pi 2 上的 dotnet 核心速度很慢
- swift - 如何使用 RxAlamofire 下载图像