org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener threw exception


Samebug tips10

A few things cause this exception:
1) Check if you have all jars and if they're in the correct path.
2) Your classpath might be broken, you can define it in the command line with java -cp yourClassPath or at your IDE if you're using one.


8 months ago
Expert tip

If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add to your dependencies. To add it, the groupId is com.fasterxml and artifactId is Classmate.


7 months ago
Expert tip

Solutions on the web33

Solution icon of spring
via Spring JIRA by Alan Yeo, 1 year ago
Listener threw exception

Solution icon of stackoverflow
Listener threw exception

Solution icon of spring
via Spring JIRA by Alan Yeo, 1 year ago
Listener threw exception

Solution icon of stackoverflow
Listener threw exception

Solution icon of stackoverflow
Listener threw exception

Solution icon of github
via GitHub by cppwfs
, 6 months ago
Listener threw exception

Solution icon of github
Listener threw exception

Solution icon of github
via GitHub by hulvyou
, 3 weeks ago
Listener threw exception

Solution icon of github
Listener threw exception

Stack trace

org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener threw exception
	at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.wrapToListenerExecutionFailedExceptionIfNeeded(AbstractMessageListenerContainer.java:865)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:760)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:680)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$001(SimpleMessageListenerContainer.java:93)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$1.invokeListener(SimpleMessageListenerContainer.java:183)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.invokeListener(SimpleMessageListenerContainer.java:1358)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:661)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:1102)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:1086)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$1100(SimpleMessageListenerContainer.java:93)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1203)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at java.lang.Thread.run(Thread.java:745)[na:1.8.0_91]
Caused by: java.lang.IllegalStateException: Could not deserialize object type
	at org.springframework.amqp.utils.SerializationUtils.deserialize(SerializationUtils.java:82)[spring-amqp-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.support.converter.SimpleMessageConverter.fromMessage(SimpleMessageConverter.java:110)[spring-amqp-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.adapter.AbstractAdaptableMessageListener.extractMessage(AbstractAdaptableMessageListener.java:185)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter$MessagingMessageConverterAdapter.extractPayload(MessagingMessageListenerAdapter.java:173)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.support.converter.MessagingMessageConverter.fromMessage(MessagingMessageConverter.java:118)[spring-amqp-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.toMessagingMessage(MessagingMessageListenerAdapter.java:102)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:88)[spring-rabbit-1.5.6.RELEASE.jar:na]
	at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:757)[spring-rabbit-1.5.6.RELEASE.jar:na]
	... 10 more
Caused by: java.lang.ClassNotFoundException: com.productservice.model.Product
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)[na:1.8.0_91]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)[na:1.8.0_91]
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)[na:1.8.0_91]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[na:1.8.0_91]
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:250)[spring-core-4.2.7.RELEASE.jar:4.2.7.RELEASE]
	at org.springframework.core.ConfigurableObjectInputStream.resolveClass(ConfigurableObjectInputStream.java:75)[spring-core-4.2.7.RELEASE.jar:4.2.7.RELEASE]
	at org.springframework.amqp.support.converter.SimpleMessageConverter$1.resolveClass(SimpleMessageConverter.java:179)[spring-amqp-1.5.6.RELEASE.jar:na]
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)[na:1.8.0_91]
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521)[na:1.8.0_91]
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1781)[na:1.8.0_91]
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)[na:1.8.0_91]
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)[na:1.8.0_91]
	at org.springframework.amqp.utils.SerializationUtils.deserialize(SerializationUtils.java:76)[spring-amqp-1.5.6.RELEASE.jar:na]
	... 17 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

2 times, 4 months ago
Once, 11 hours ago
Samebug visitor profile picture
Unknown user
Once, 1 day ago
Samebug visitor profile picture
Unknown user
Once, 1 week ago
19 times, 1 week ago
2468 more bugmates