首页 > 解决方案 > 获取 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 服务运行时出现此错误。如何在服务器级别解决这个问题?

标签: linuxspring-bootspring-amqpspring-messaging

解决方案


我会推荐org.springframework.boot:spring-boot-starter-amqpover the,spring-rabbit因为你使用的是spring boot。

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


推荐阅读