Linux 获取java.lang.noclassdeffounderror:org.springframework/amqp/core/coreration

Linux 获取java.lang.noclassdeffounderror:org.springframework/amqp/core/coreration,linux,spring-boot,spring-amqp,spring-messaging,Linux,Spring Boot,Spring Amqp,Spring Messaging,我的spring_boot_版本为“2.0.5.RELEASE”,spring_版本为“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-sta

我的spring_boot_版本为“2.0.5.RELEASE”,spring_版本为“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"
该应用程序在我的本地机器上运行良好,但我在linux服务器上作为systemd服务运行spring boot服务器时遇到了此错误。
如何在服务器级别解决这个问题?

我建议使用
org.springframework.boot:springbootstarteramqp
而不是
springrabbit
,因为您使用的是springboot


您看到的错误可能是因为您还需要添加
org.springframework.amqp:springamqp

如果我使用它,我应该使用什么版本?一定有不同的东西;2.1.4与Boot2.0.5不兼容(Boot2.0.x需要Spring5.0.x,而不是4.3.x)。Boot 2.0.x与spring amqp 2.0.x配合使用,Boot 2.1.x与amqp 2.1.x配合使用。正如@devshawn所说,最好使用启动程序,这样您就可以获得所有正确的依赖项;使用与启动相同的启动版本。@viraj-它可能在本地工作,因为java类路径上有其他东西,比如,如果您使用的是IDE,并且是通过
build.gradle
以外的东西导入的,正如@Gary Russell所说,我会尝试SpringBootStarter amqp,并使用与该依赖项相同的SpringBoot版本(并删除显式SpringRabbit依赖项)。