1

My spring_boot_version is '2.0.5.RELEASE',spring_version = '4.3.8.RELEASE' and the spring dependencies that i am using running for rabbit mq is:

 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"

The app works fine in my local machine but i am getting this error while running the spring boot server as a systemd service on linux server. How to resolve this on server level?

soorapadman
  • 4,451
  • 7
  • 35
  • 47
viraj
  • 129
  • 9

1 Answers1

1

I would recommend the org.springframework.boot:spring-boot-starter-amqp over the spring-rabbit since you're using spring boot.

The error you're seeing is likely because you need to add org.springframework.amqp:spring-amqp as well.

devshawn
  • 701
  • 5
  • 9
  • and if i use it what version should i use? – viraj Apr 09 '19 at 05:10
  • 1
    There must be something different; 2.1.4 is simply not compatible with Boot 2.0.5 (and boot 2.0.x requires spring 5.0.x, not 4.3.x). Boot 2.0.x works with spring amqp 2.0.x, boot 2.1.x works with amqp 2.1.x. As @devshawn says, it's better to use the boot starter so you get all the right dependencies; use the same starter version as your boot. – Gary Russell Apr 09 '19 at 12:41
  • @viraj - It could be working locally due to something else being on your java classpath, like if you're using an IDE and imported through something other than the `build.gradle` -- as @Gary Russell said, I'd try the spring-boot-starter-amqp and use the same spring boot version you're using for that dependency (and remove the explicit spring-rabbit dependency). – devshawn Apr 09 '19 at 13:36