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

3,233 views
Skip to first unread message

Babasaheb Patil

unread,
Jun 19, 2017, 1:56:08 PM6/19/17
to rabbitmq-users
Hi,

I'm trying to use simple JSON  object to be passed through Rabbit MQ. 

I converted the JSON object to String and sent and when I received it, I simply converted it back to MongoDB Document/Entity object. In debug mode I can see it nicely got passed through Queue and got consumed and got converted back to Entity/Document Object using JSON parser.

After that, I tried to insert that object in MongoDB then it's failing for below error.

Can someone help me with this error ?


Thanks
Baba

Error Log:



2017-06-19 13:47:31.231  INFO 74507 --- [           main] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4f209819: startup date [Mon Jun 19 13:47:15 EDT 2017]; root of context hierarchy

Received message

 [x] Received '{"patientFirstName":"Dave","claimAmount":37.5,"claimID":3751,"claimNumber":"NJ-3789","patientLastName":"Smith"}'

ClaimData 'Dave  37.5'

2017-06-19 13:47:31.334  WARN 74507 --- [cTaskExecutor-1] s.a.r.l.ConditionalRejectingErrorHandler : Execution of Rabbit message listener failed.


org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener method 'receiveMessage' threw exception

at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.invokeListenerMethod(MessageListenerAdapter.java:391) ~[spring-rabbit-1.5.1.RELEASE.jar:na]

at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.onMessage(MessageListenerAdapter.java:294) ~[spring-rabbit-1.5.1.RELEASE.jar:na]

at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:757) ~[spring-rabbit-1.5.1.RELEASE.jar:na]

at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:680) ~[spring-rabbit-1.5.1.RELEASE.jar:na]

at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$001(SimpleMessageListenerContainer.java:93) [spring-rabbit-1.5.1.RELEASE.jar:na]

at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$1.invokeListener(SimpleMessageListenerContainer.java:183) ~[spring-rabbit-1.5.1.RELEASE.jar:na]

at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.invokeListener(SimpleMessageListenerContainer.java:1345) [spring-rabbit-1.5.1.RELEASE.jar:na]

at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:661) ~[spring-rabbit-1.5.1.RELEASE.jar:na]

at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:1096) [spring-rabbit-1.5.1.RELEASE.jar:na]

at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:1080) [spring-rabbit-1.5.1.RELEASE.jar:na]

at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$800(SimpleMessageListenerContainer.java:93) [spring-rabbit-1.5.1.RELEASE.jar:na]

at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1190) [spring-rabbit-1.5.1.RELEASE.jar:na]

at java.lang.Thread.run(Thread.java:745) [na:1.8.0_51]

Caused by: java.lang.NullPointerException: null

at galaxe.mq.services.MessageReceiver.createClaim(MessageReceiver.java:95) ~[classes/:na]

at galaxe.mq.services.MessageReceiver.receiveMessage(MessageReceiver.java:59) ~[classes/:na]

at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source) ~[na:na]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_51]

at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_51]

at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:269) ~[spring-core-4.3.6.RELEASE.jar:4.3.6.RELEASE]

at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.invokeListenerMethod(MessageListenerAdapter.java:383) ~[spring-rabbit-1.5.1.RELEASE.jar:na]

... 12 common frames omitted

Gary Russell

unread,
Jun 19, 2017, 2:01:33 PM6/19/17
to rabbitm...@googlegroups.com
>Caused by: java.lang.NullPointerException: null

>at galaxe.mq.services.MessageReceiver.createClaim(MessageReceiver.java:95) ~[classes/:na]


Looks like a problem (NPE) in your listener.



--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Babasaheb Patil

unread,
Jun 19, 2017, 2:05:22 PM6/19/17
to rabbitm...@googlegroups.com
Thank Gary. But I can see that message got consumed as I was able to read message and convert it back to Documet object.

But after mongoopertaions.save command while inserting the document to MongoDb its failing.

Gary, if you have time can we zoom in meeting and take a look at it if you have time ?

Thanks
Baba

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.

To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/_yTKARENZyM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

Gary Russell

unread,
Jun 19, 2017, 2:12:07 PM6/19/17
to rabbitm...@googlegroups.com
No; I can't provide individual support; you are clearly getting a NullPointerException in your code; use a debugger.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.

To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/_yTKARENZyM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

Babasaheb Patil

unread,
Jun 19, 2017, 2:44:45 PM6/19/17
to rabbitm...@googlegroups.com
Garry, 

As its a Spring Boot and Rabbit MQ application, is it having below issue that you replied someone?



YOn Thursday, February 18, 2016 at 8:45:08 AM UTC-5, Gary Russell wrote:
You are creating two separate application contexts:

context = new AnnotationConfigApplicationContext(AMQPPoCReceiverApplication.class);

is not needed.

SpringApplication.run(AMQPPoCReceiverApplication.class, args);

also creates one. You should not create another context in CommandLineRunner.run(). Simply use:

ConfigurableApplicationContext context = SpringApplication.run(AMQPPoCReceiverApplication.class, args);


On Thu, Feb 18, 2016 at 6:22 AM, Michael Klishin <mkli...@pivotal.io> wrote:
On 18 February 2016 at 14:21:14, Anthony Kinaesthetic (anthony....@gmail.com) wrote:
> I posted here first because it could have been known issue from
> RabbitMQ.

I bet it's a misconfiguration and not a bug in any of the projects :)
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/_yTKARENZyM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-users+unsubscribe@googlegroups.com.

To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Babasaheb Patil

unread,
Jun 19, 2017, 2:48:54 PM6/19/17
to rabbitm...@googlegroups.com
Hi Gary,

Because in debug, this is what I found.

2017-06-19 14:32:06.025  INFO 76687 --- [           main] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@5c2375a9: startup date [Mon Jun 19 14:31:48 EDT 2017]; root of context hierarchy

2017-06-19 14:32:06.028  INFO 76687 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Stopping beans in phase 2147483647

2017-06-19 14:32:06.032  INFO 76687 --- [           main] o.s.a.r.l.SimpleMessageListenerContainer : Waiting for workers to finish.

2017-06-19 14:32:11.035  INFO 76687 --- [           main] o.s.a.r.l.SimpleMessageListenerContainer : Workers not finished.  Forcing connections to close.

2017-06-19 14:32:11.036  INFO 76687 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown

2017-06-19 14:32:15.087  INFO 76687 --- [           main] galaxe.mq.services.Application           : Started Application in 27.894 seconds (JVM running for 28.677)

Gary Russell

unread,
Jun 19, 2017, 4:57:38 PM6/19/17
to rabbitm...@googlegroups.com
I replied because you implied it was a Spring AMQP issue and the stack trace shows you are using it.

That log does not help without more context.

Since your issue has nothing to do with RabbitMQ, I suggest you move the discussion to Stack Overflow [1] or Gitter [2].

In either case, you must provide much more information, code, logs; and first of all, figure out your NullPointerException.


To post to this group, send email to rabbitmq-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages