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

8.4k views Asked by At

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

1

There are 1 answers

0
Nicolas Labrot On

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>