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

Spring JIRA | Alan Yeo | 5 months ago
  1. 0

    I've provided a demo application for this issue. If you were to comment out line 39 in SpringBootDevtoolsAmqpApplication.java and run the application, you will find that it will break and log the following stacktrace: {code} 2016-06-22 15:33:53.396 WARN 71837 --- [cTaskExecutor-1] s.a.r.l.ConditionalRejectingErrorHandler : Execution of Rabbit message listener failed. org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener threw exception at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.wrapToListenerExecutionFailedExceptionIfNeeded(AbstractMessageListenerContainer.java:870) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:780) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:700) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$001(SimpleMessageListenerContainer.java:95) [spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$1.invokeListener(SimpleMessageListenerContainer.java:187) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.invokeListener(SimpleMessageListenerContainer.java:1186) [spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:681) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:1164) [spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:1148) [spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$1100(SimpleMessageListenerContainer.java:95) [spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1311) [spring-rabbit-1.6.0.RC1.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_77] Caused by: org.springframework.amqp.AmqpException: No method found for class io.pivotal.singapore.SomeEvent at org.springframework.amqp.rabbit.listener.adapter.DelegatingInvocableHandler.getHandlerForPayload(DelegatingInvocableHandler.java:127) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.adapter.DelegatingInvocableHandler.getMethodNameFor(DelegatingInvocableHandler.java:224) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.adapter.HandlerAdapter.getMethodAsString(HandlerAdapter.java:61) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:138) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:105) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:777) ~[spring-rabbit-1.6.0.RC1.jar:na] ... 10 common frames omitted {code} I've looked into the code and it seems like it should be looking up AppClassLoader instead of RestartClassLoader.

    Spring JIRA | 5 months ago | Alan Yeo
    org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener threw exception
  2. 0

    I've provided a demo application for this issue. If you were to comment out line 39 in SpringBootDevtoolsAmqpApplication.java and run the application, you will find that it will break and log the following stacktrace: {code} 2016-06-22 15:33:53.396 WARN 71837 --- [cTaskExecutor-1] s.a.r.l.ConditionalRejectingErrorHandler : Execution of Rabbit message listener failed. org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener threw exception at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.wrapToListenerExecutionFailedExceptionIfNeeded(AbstractMessageListenerContainer.java:870) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:780) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:700) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$001(SimpleMessageListenerContainer.java:95) [spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$1.invokeListener(SimpleMessageListenerContainer.java:187) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.invokeListener(SimpleMessageListenerContainer.java:1186) [spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:681) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:1164) [spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:1148) [spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$1100(SimpleMessageListenerContainer.java:95) [spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1311) [spring-rabbit-1.6.0.RC1.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_77] Caused by: org.springframework.amqp.AmqpException: No method found for class io.pivotal.singapore.SomeEvent at org.springframework.amqp.rabbit.listener.adapter.DelegatingInvocableHandler.getHandlerForPayload(DelegatingInvocableHandler.java:127) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.adapter.DelegatingInvocableHandler.getMethodNameFor(DelegatingInvocableHandler.java:224) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.adapter.HandlerAdapter.getMethodAsString(HandlerAdapter.java:61) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:138) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:105) ~[spring-rabbit-1.6.0.RC1.jar:na] at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:777) ~[spring-rabbit-1.6.0.RC1.jar:na] ... 10 common frames omitted {code} I've looked into the code and it seems like it should be looking up AppClassLoader instead of RestartClassLoader.

    Spring JIRA | 5 months ago | Alan Yeo
    org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener threw exception
  3. 0

    Fixed reply queue times out after second message

    Stack Overflow | 2 years ago | Jan Vladimir Mostert
    org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener threw exception
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Several beans implementating the same interface

    Stack Overflow | 2 years ago
    org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener method 'public void com.everymatrix.om2020.messaging.model.SnapshotClient.handleMessage(org.springframework.messaging.Message<E>,java.time.Instant)' threw exception
  6. 0

    GitHub comment 35#170048719

    GitHub | 11 months ago | garyrussell
    org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener method 'public void foo.Consumer.handleHello1(java.lang.String)' threw exception

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.amqp.AmqpException

      No method found for class io.pivotal.singapore.SomeEvent

      at org.springframework.amqp.rabbit.listener.adapter.DelegatingInvocableHandler.getHandlerForPayload()
    2. Spring RabbitMQ Support
      SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run
      1. org.springframework.amqp.rabbit.listener.adapter.DelegatingInvocableHandler.getHandlerForPayload(DelegatingInvocableHandler.java:127)[spring-rabbit-1.6.0.RC1.jar:na]
      2. org.springframework.amqp.rabbit.listener.adapter.DelegatingInvocableHandler.getMethodNameFor(DelegatingInvocableHandler.java:224)[spring-rabbit-1.6.0.RC1.jar:na]
      3. org.springframework.amqp.rabbit.listener.adapter.HandlerAdapter.getMethodAsString(HandlerAdapter.java:61)[spring-rabbit-1.6.0.RC1.jar:na]
      4. org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:138)[spring-rabbit-1.6.0.RC1.jar:na]
      5. org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:105)[spring-rabbit-1.6.0.RC1.jar:na]
      6. org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:777)[spring-rabbit-1.6.0.RC1.jar:na]
      7. org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:700)[spring-rabbit-1.6.0.RC1.jar:na]
      8. org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$001(SimpleMessageListenerContainer.java:95)[spring-rabbit-1.6.0.RC1.jar:na]
      9. org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$1.invokeListener(SimpleMessageListenerContainer.java:187)[spring-rabbit-1.6.0.RC1.jar:na]
      10. org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.invokeListener(SimpleMessageListenerContainer.java:1186)[spring-rabbit-1.6.0.RC1.jar:na]
      11. org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:681)[spring-rabbit-1.6.0.RC1.jar:na]
      12. org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:1164)[spring-rabbit-1.6.0.RC1.jar:na]
      13. org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:1148)[spring-rabbit-1.6.0.RC1.jar:na]
      14. org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$1100(SimpleMessageListenerContainer.java:95)[spring-rabbit-1.6.0.RC1.jar:na]
      15. org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1311)[spring-rabbit-1.6.0.RC1.jar:na]
      15 frames
    3. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)[na:1.8.0_77]
      1 frame