Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting "java.lang.NoClassDefFoundError: com/rabbitmq/client/impl/LongString" while retrieving messages from reply Q

Tags:

spring-amqp

I am using spring-integration-amqp 4.1.4 with rabbitmq amqp-client 3.5.3. Messages are being delivered alright but reply messages retrieval raises following exception.

org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer - Consumer raised exception, processing can restart if the connection factory supports it

java.lang.NoClassDefFoundError: com/rabbitmq/client/impl/LongString

exception logs

like image 573
Alok Sharma Avatar asked Nov 01 '22 02:11

Alok Sharma


1 Answers

Please consider formatting your question correctly.

It seems that you have a dependency that depends itself on an old version of rabbitmq-java-client (<2.6). LongString package is now com.rabbitmq.client not com.rabbitmq.client.impl

If you are using maven, try to launch a mvn dependency:tree > deps.txt, open deps.txt and find which dependency cause this issue.

You could try to depend directly on amqp-client, but it may hide the issue:

<dependency>
  <groupId>com.rabbitmq</groupId>
  <artifactId>amqp-client</artifactId>
  <version>3.5.1</version>
  <scope>compile</scope>
</dependency> 
like image 104
Nicolas Labrot Avatar answered Jan 04 '23 14:01

Nicolas Labrot