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

    HQL Exception (org.hibernate.dialect.Dialect$3)

    Stack Overflow | 4 years ago | Hari
    java.lang.NullPointerException: null
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Error loading model properties in JPA on play 2.0.3

    Stack Overflow | 4 years ago | Chappies
    java.lang.NullPointerException: null

    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