org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException

Listener method could not be invoked with the incoming message Endpoint handler details: Method [public void org.springframework.amqp.rabbit.listener.MethodRabbitListenerEndpointTests$RabbitEndpointSampleBean.invalidMessagePayloadType(org.springframework.messaging.Message<java.lang.Integer>)] Bean [org.springframework.amqp.rabbit.listener.MethodRabbitListenerEndpointTests$RabbitEndpointSampleBean@258e2e41]

Solutions on the web44

  • via Spring JIRA by Artem Bilan, 1 year ago
    Listener method could not be invoked with the incoming message Endpoint handler details: Method [public void org.springframework.amqp.rabbit.listener.MethodRabbitListenerEndpointTests$RabbitEndpointSampleBean.invalidMessagePayloadType
  • via Spring JIRA by Artem Bilan, 1 year ago
    Listener method could not be invoked with the incoming message Endpoint handler details: Method [public void org.springframework.amqp.rabbit.listener.MethodRabbitListenerEndpointTests$RabbitEndpointSampleBean.invalidMessagePayloadType
  • Listener method could not be invoked with the incoming message Endpoint handler details: Method [public void demo.consumer.Receiver.receiveMessage(demo.consumer.Bar)] Bean [demo.consumer.Receiver@1672fe87]
  • Stack trace

    • org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener method could not be invoked with the incoming message Endpoint handler details: Method [public void org.springframework.amqp.rabbit.listener.MethodRabbitListenerEndpointTests$RabbitEndpointSampleBean.invalidMessagePayloadType(org.springframework.messaging.Message<java.lang.Integer>)] Bean [org.springframework.amqp.rabbit.listener.MethodRabbitListenerEndpointTests$RabbitEndpointSampleBean@258e2e41] at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:120) at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:92) at org.springframework.amqp.rabbit.listener.MethodRabbitListenerEndpointTests.invalidMessagePayloadType(MethodRabbitListenerEndpointTests.java:392) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55) at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:168) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) Caused by: org.springframework.messaging.handler.annotation.support.MethodArgumentTypeMismatchException: Could not resolve method parameter at index 0 in method: public void org.springframework.amqp.rabbit.listener.MethodRabbitListenerEndpointTests$RabbitEndpointSampleBean.invalidMessagePayloadType(org.springframework.messaging.Message<java.lang.Integer>) The expected Message<?> payload type [java.lang.Integer] does not match the actual payload type [java.lang.String] at org.springframework.messaging.handler.annotation.support.MessageMethodArgumentResolver.resolveArgument(MessageMethodArgumentResolver.java:56) at org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77) at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:139) at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:108) at org.springframework.amqp.rabbit.listener.adapter.HandlerAdapter.invoke(HandlerAdapter.java:48) at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:112)

    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

    You are the first who have seen this exception. Write a tip to help other users and build your expert profile.