java.lang.NullPointerException: null

Spring JIRA | Flemming Jønsson | 2 years ago
  1. 0

    I have a session in TRX mode and this inbound-gateway config {code} <smpp:inbound-gateway smpp-session-ref="session" request-channel="rawIncomingSmsChannel" request-timeout="60000" /> {code} With this config I get Nullpointers every now and then like these: {code} java.lang.NullPointerException: null at org.springframework.integration.smpp.core.SmesMessageSpecification.fromMessage(SmesMessageSpecification.java:180) at org.springframework.integration.smpp.inbound.SmppInboundGateway$1.onTextMessage(SmppInboundGateway.java:97) at org.springframework.integration.smpp.core.AbstractReceivingMessageListener.onAcceptDeliverSm(AbstractReceivingMessageListener.java:58) at org.springframework.integration.smpp.session.DelegatingMessageReceiverListener.onAcceptDeliverSm(DelegatingMessageReceiverListener.java:44) at org.jsmpp.session.SMPPSession.fireAcceptDeliverSm(SMPPSession.java:457) at org.jsmpp.session.SMPPSession.access$400(SMPPSession.java:92) at org.jsmpp.session.SMPPSession$ResponseHandlerImpl.processDeliverSm(SMPPSession.java:474) at org.jsmpp.session.state.SMPPSessionBoundRX.processDeliverSm0(SMPPSessionBoundRX.java:109) at org.jsmpp.session.state.SMPPSessionBoundTRX.processDeliverSm(SMPPSessionBoundTRX.java:42) at org.jsmpp.session.PDUProcessTask.run(PDUProcessTask.java:81) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Exception in thread "pool-2-thread-8" java.lang.RuntimeException: java.lang.NullPointerException at org.springframework.integration.smpp.core.AbstractReceivingMessageListener.onAcceptDeliverSm(AbstractReceivingMessageListener.java:61) at org.springframework.integration.smpp.session.DelegatingMessageReceiverListener.onAcceptDeliverSm(DelegatingMessageReceiverListener.java:44) at org.jsmpp.session.SMPPSession.fireAcceptDeliverSm(SMPPSession.java:457) at org.jsmpp.session.SMPPSession.access$400(SMPPSession.java:92) at org.jsmpp.session.SMPPSession$ResponseHandlerImpl.processDeliverSm(SMPPSession.java:474) at org.jsmpp.session.state.SMPPSessionBoundRX.processDeliverSm0(SMPPSessionBoundRX.java:109) at org.jsmpp.session.state.SMPPSessionBoundTRX.processDeliverSm(SMPPSessionBoundTRX.java:42) at org.jsmpp.session.PDUProcessTask.run(PDUProcessTask.java:81) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at org.springframework.integration.smpp.core.SmesMessageSpecification.fromMessage(SmesMessageSpecification.java:180) at org.springframework.integration.smpp.inbound.SmppInboundGateway$1.onTextMessage(SmppInboundGateway.java:97) at org.springframework.integration.smpp.core.AbstractReceivingMessageListener.onAcceptDeliverSm(AbstractReceivingMessageListener.java:58) ... 10 more {code} The code causing the problem is in org.springframework.integration.smpp.core.AbstractReceivingMessageListener#onTextMessage. When the result of sendAndReceiveMessage(msg) is null, the following line trying to return the reply fails with nullpointerexception because SmesMessageSpecification.fromMessage is not guarded against a msg that is null. A simple check for null before trying to return the reply would probably resolve the issue

    Spring JIRA | 2 years ago | Flemming Jønsson
    java.lang.NullPointerException: null
  2. 0

    I have a session in TRX mode and this inbound-gateway config {code} <smpp:inbound-gateway smpp-session-ref="session" request-channel="rawIncomingSmsChannel" request-timeout="60000" /> {code} With this config I get Nullpointers every now and then like these: {code} java.lang.NullPointerException: null at org.springframework.integration.smpp.core.SmesMessageSpecification.fromMessage(SmesMessageSpecification.java:180) at org.springframework.integration.smpp.inbound.SmppInboundGateway$1.onTextMessage(SmppInboundGateway.java:97) at org.springframework.integration.smpp.core.AbstractReceivingMessageListener.onAcceptDeliverSm(AbstractReceivingMessageListener.java:58) at org.springframework.integration.smpp.session.DelegatingMessageReceiverListener.onAcceptDeliverSm(DelegatingMessageReceiverListener.java:44) at org.jsmpp.session.SMPPSession.fireAcceptDeliverSm(SMPPSession.java:457) at org.jsmpp.session.SMPPSession.access$400(SMPPSession.java:92) at org.jsmpp.session.SMPPSession$ResponseHandlerImpl.processDeliverSm(SMPPSession.java:474) at org.jsmpp.session.state.SMPPSessionBoundRX.processDeliverSm0(SMPPSessionBoundRX.java:109) at org.jsmpp.session.state.SMPPSessionBoundTRX.processDeliverSm(SMPPSessionBoundTRX.java:42) at org.jsmpp.session.PDUProcessTask.run(PDUProcessTask.java:81) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Exception in thread "pool-2-thread-8" java.lang.RuntimeException: java.lang.NullPointerException at org.springframework.integration.smpp.core.AbstractReceivingMessageListener.onAcceptDeliverSm(AbstractReceivingMessageListener.java:61) at org.springframework.integration.smpp.session.DelegatingMessageReceiverListener.onAcceptDeliverSm(DelegatingMessageReceiverListener.java:44) at org.jsmpp.session.SMPPSession.fireAcceptDeliverSm(SMPPSession.java:457) at org.jsmpp.session.SMPPSession.access$400(SMPPSession.java:92) at org.jsmpp.session.SMPPSession$ResponseHandlerImpl.processDeliverSm(SMPPSession.java:474) at org.jsmpp.session.state.SMPPSessionBoundRX.processDeliverSm0(SMPPSessionBoundRX.java:109) at org.jsmpp.session.state.SMPPSessionBoundTRX.processDeliverSm(SMPPSessionBoundTRX.java:42) at org.jsmpp.session.PDUProcessTask.run(PDUProcessTask.java:81) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at org.springframework.integration.smpp.core.SmesMessageSpecification.fromMessage(SmesMessageSpecification.java:180) at org.springframework.integration.smpp.inbound.SmppInboundGateway$1.onTextMessage(SmppInboundGateway.java:97) at org.springframework.integration.smpp.core.AbstractReceivingMessageListener.onAcceptDeliverSm(AbstractReceivingMessageListener.java:58) ... 10 more {code} The code causing the problem is in org.springframework.integration.smpp.core.AbstractReceivingMessageListener#onTextMessage. When the result of sendAndReceiveMessage(msg) is null, the following line trying to return the reply fails with nullpointerexception because SmesMessageSpecification.fromMessage is not guarded against a msg that is null. A simple check for null before trying to return the reply would probably resolve the issue

    Spring JIRA | 2 years ago | Flemming Jønsson
    java.lang.NullPointerException: null
  3. 0
    Elasticsearch 1.x and 2.x nodes are not compatible, make sure your setup contains nodes of the same major version.
    via GitHub by dakrone
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    It is a JDK bug, no workaround currently.
    via GitHub by jroper
  6. 0
    Some of the parametes ar enull

    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

      null

      at org.springframework.integration.smpp.core.SmesMessageSpecification.fromMessage()
    2. org.springframework.integration
      DelegatingMessageReceiverListener.onAcceptDeliverSm
      1. org.springframework.integration.smpp.core.SmesMessageSpecification.fromMessage(SmesMessageSpecification.java:180)
      2. org.springframework.integration.smpp.inbound.SmppInboundGateway$1.onTextMessage(SmppInboundGateway.java:97)
      3. org.springframework.integration.smpp.core.AbstractReceivingMessageListener.onAcceptDeliverSm(AbstractReceivingMessageListener.java:58)
      4. org.springframework.integration.smpp.session.DelegatingMessageReceiverListener.onAcceptDeliverSm(DelegatingMessageReceiverListener.java:44)
      4 frames
    3. Apache ServiceMix :: Bundles :: ${pkgArtifactId}
      PDUProcessTask.run
      1. org.jsmpp.session.SMPPSession.fireAcceptDeliverSm(SMPPSession.java:457)
      2. org.jsmpp.session.SMPPSession.access$400(SMPPSession.java:92)
      3. org.jsmpp.session.SMPPSession$ResponseHandlerImpl.processDeliverSm(SMPPSession.java:474)
      4. org.jsmpp.session.state.SMPPSessionBoundRX.processDeliverSm0(SMPPSessionBoundRX.java:109)
      5. org.jsmpp.session.state.SMPPSessionBoundTRX.processDeliverSm(SMPPSessionBoundTRX.java:42)
      6. org.jsmpp.session.PDUProcessTask.run(PDUProcessTask.java:81)
      6 frames
    4. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      3. java.lang.Thread.run(Thread.java:745)
      3 frames