java.lang.NullPointerException

Spring JIRA | Andrey Paramonov | 6 years ago
  1. 0

    I send a message using RabbitMQ Java client - com.rabbitmq.client.Channel#basicPublish(String, String, BasicProperties, byte[]) - with null BasicProperties, which seems to be a valid case. I get NPE when I try to print the message within the MessageListener implementation: {code} java.lang.NullPointerException at org.springframework.amqp.core.Message.getBodyContentAsString(Message.java:70) at org.springframework.amqp.core.Message.toString(Message.java:56) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at com.ndpar.spring.rabbitmq.MessageHandler.onMessage(MessageHandler.java:14) at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:316) at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:254) at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:230) at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:199) at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.processMessage(SimpleMessageListenerContainer.java:229) at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:288) at java.lang.Thread.run(Thread.java:637) {code}

    Spring JIRA | 6 years ago | Andrey Paramonov
    java.lang.NullPointerException
  2. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

    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. java.lang.NullPointerException

      No message provided

      at org.springframework.amqp.core.Message.getBodyContentAsString()
    2. Spring AMQP Core
      Message.toString
      1. org.springframework.amqp.core.Message.getBodyContentAsString(Message.java:70)
      2. org.springframework.amqp.core.Message.toString(Message.java:56)
      2 frames
    3. Java RT
      StringBuilder.append
      1. java.lang.String.valueOf(String.java:2826)
      2. java.lang.StringBuilder.append(StringBuilder.java:115)
      2 frames
    4. com.ndpar.spring
      MessageHandler.onMessage
      1. com.ndpar.spring.rabbitmq.MessageHandler.onMessage(MessageHandler.java:14)
      1 frame
    5. Spring RabbitMQ Support
      SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run
      1. org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:316)
      2. org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:254)
      3. org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:230)
      4. org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:199)
      5. org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.processMessage(SimpleMessageListenerContainer.java:229)
      6. org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:288)
      6 frames
    6. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:637)
      1 frame