org.springframework.messaging.MessageDeliveryException: Failed to send message to ExecutorSubscribableChannel[clientInboundChannel]; nested exception is java.lang.NullPointerException

Spring JIRA | Bjorn Harvold | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I upgraded to the RC2 and read up on the changes that had been made. In particular the CSRF work. So, I enabled csrf support, created a CsrfController that could return me my CsrfToken so I could use it to inject into my web socket headers. I injected the headers into my stomp connect and that seems to work: >>> CONNECT X-CSRF-TOKEN:5da70ca4-b8ee-4242-b6bb-17e66a733cff accept-version:1.1,1.0 heart-beat:10000,10000 I then try to subscribe to the channel so I can listen to messages. I add the same csrf header to the stomp subscribe method (don't know if I need it) but it fails pretty badly. Stacktrace: 2015-03-05 14:04:21,845 ERROR StompSubProtocolHandler.handleMessageFromClient():274 Failed to send client message to application via MessageChannel in session 0ery4yvi. Sending STOMP ERROR to client. org.springframework.messaging.MessageDeliveryException: Failed to send message to ExecutorSubscribableChannel[clientInboundChannel]; nested exception is java.lang.NullPointerException at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:127) at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:104) at org.springframework.web.socket.messaging.StompSubProtocolHandler.handleMessageFromClient(StompSubProtocolHandler.java:267) at org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.handleMessage(SubProtocolWebSocketHandler.java:309) at org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage(WebSocketHandlerDecorator.java:75) at org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator.handleMessage(LoggingWebSocketHandlerDecorator.java:56) at org.springframework.web.socket.handler.ExceptionWebSocketHandlerDecorator.handleMessage(ExceptionWebSocketHandlerDecorator.java:72) at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.delegateMessages(AbstractSockJsSession.java:385) at org.springframework.web.socket.sockjs.transport.session.WebSocketServerSockJsSession.handleMessage(WebSocketServerSockJsSession.java:194) at org.springframework.web.socket.sockjs.transport.handler.SockJsWebSocketHandler.handleTextMessage(SockJsWebSocketHandler.java:92) at org.springframework.web.socket.handler.AbstractWebSocketHandler.handleMessage(AbstractWebSocketHandler.java:43) at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.handleTextMessage(StandardWebSocketHandlerAdapter.java:112) at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.access$000(StandardWebSocketHandlerAdapter.java:42) at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:82) at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:79) at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:393) at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:494) at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:289) at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:130) at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:60) at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:203) at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:194) at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:95) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:653) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:744) Caused by: java.lang.NullPointerException at org.apache.catalina.connector.Request.parseCookies(Request.java:2886) at org.apache.catalina.connector.Request.convertCookies(Request.java:2901) at org.apache.catalina.connector.Request.getCookies(Request.java:1930) at org.apache.catalina.connector.RequestFacade.getCookies(RequestFacade.java:662) at javax.servlet.http.HttpServletRequestWrapper.getCookies(HttpServletRequestWrapper.java:69) at javax.servlet.http.HttpServletRequestWrapper.getCookies(HttpServletRequestWrapper.java:69) at org.springframework.session.web.http.CookieHttpSessionStrategy.getCookie(CookieHttpSessionStrategy.java:294) at org.springframework.session.web.http.CookieHttpSessionStrategy.getSessionIds(CookieHttpSessionStrategy.java:310) at org.springframework.session.web.http.CookieHttpSessionStrategy.getRequestedSessionId(CookieHttpSessionStrategy.java:165) at org.springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.getRequestedSessionId(SessionRepositoryFilter.java:213) at org.springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.getSession(SessionRepositoryFilter.java:188) at org.springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.getSession(SessionRepositoryFilter.java:208) at org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.saveToken(HttpSessionCsrfTokenRepository.java:57) at org.springframework.security.web.csrf.CsrfFilter$SaveOnAccessCsrfToken.saveTokenIfNecessary(CsrfFilter.java:219) at org.springframework.security.web.csrf.CsrfFilter$SaveOnAccessCsrfToken.getToken(CsrfFilter.java:177) at org.springframework.security.messaging.web.csrf.CsrfChannelInterceptor.preSend(CsrfChannelInterceptor.java:56) at org.springframework.messaging.support.AbstractMessageChannel$ChannelInterceptorChain.applyPreSend(AbstractMessageChannel.java:158) at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:113) ... 30 more Any ideas?

    Spring JIRA | 2 years ago | Bjorn Harvold
    org.springframework.messaging.MessageDeliveryException: Failed to send message to ExecutorSubscribableChannel[clientInboundChannel]; nested exception is java.lang.NullPointerException
  2. 0

    I upgraded to the RC2 and read up on the changes that had been made. In particular the CSRF work. So, I enabled csrf support, created a CsrfController that could return me my CsrfToken so I could use it to inject into my web socket headers. I injected the headers into my stomp connect and that seems to work: >>> CONNECT X-CSRF-TOKEN:5da70ca4-b8ee-4242-b6bb-17e66a733cff accept-version:1.1,1.0 heart-beat:10000,10000 I then try to subscribe to the channel so I can listen to messages. I add the same csrf header to the stomp subscribe method (don't know if I need it) but it fails pretty badly. Stacktrace: 2015-03-05 14:04:21,845 ERROR StompSubProtocolHandler.handleMessageFromClient():274 Failed to send client message to application via MessageChannel in session 0ery4yvi. Sending STOMP ERROR to client. org.springframework.messaging.MessageDeliveryException: Failed to send message to ExecutorSubscribableChannel[clientInboundChannel]; nested exception is java.lang.NullPointerException at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:127) at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:104) at org.springframework.web.socket.messaging.StompSubProtocolHandler.handleMessageFromClient(StompSubProtocolHandler.java:267) at org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.handleMessage(SubProtocolWebSocketHandler.java:309) at org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage(WebSocketHandlerDecorator.java:75) at org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator.handleMessage(LoggingWebSocketHandlerDecorator.java:56) at org.springframework.web.socket.handler.ExceptionWebSocketHandlerDecorator.handleMessage(ExceptionWebSocketHandlerDecorator.java:72) at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.delegateMessages(AbstractSockJsSession.java:385) at org.springframework.web.socket.sockjs.transport.session.WebSocketServerSockJsSession.handleMessage(WebSocketServerSockJsSession.java:194) at org.springframework.web.socket.sockjs.transport.handler.SockJsWebSocketHandler.handleTextMessage(SockJsWebSocketHandler.java:92) at org.springframework.web.socket.handler.AbstractWebSocketHandler.handleMessage(AbstractWebSocketHandler.java:43) at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.handleTextMessage(StandardWebSocketHandlerAdapter.java:112) at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.access$000(StandardWebSocketHandlerAdapter.java:42) at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:82) at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:79) at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:393) at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:494) at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:289) at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:130) at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:60) at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:203) at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:194) at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:95) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:653) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:744) Caused by: java.lang.NullPointerException at org.apache.catalina.connector.Request.parseCookies(Request.java:2886) at org.apache.catalina.connector.Request.convertCookies(Request.java:2901) at org.apache.catalina.connector.Request.getCookies(Request.java:1930) at org.apache.catalina.connector.RequestFacade.getCookies(RequestFacade.java:662) at javax.servlet.http.HttpServletRequestWrapper.getCookies(HttpServletRequestWrapper.java:69) at javax.servlet.http.HttpServletRequestWrapper.getCookies(HttpServletRequestWrapper.java:69) at org.springframework.session.web.http.CookieHttpSessionStrategy.getCookie(CookieHttpSessionStrategy.java:294) at org.springframework.session.web.http.CookieHttpSessionStrategy.getSessionIds(CookieHttpSessionStrategy.java:310) at org.springframework.session.web.http.CookieHttpSessionStrategy.getRequestedSessionId(CookieHttpSessionStrategy.java:165) at org.springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.getRequestedSessionId(SessionRepositoryFilter.java:213) at org.springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.getSession(SessionRepositoryFilter.java:188) at org.springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.getSession(SessionRepositoryFilter.java:208) at org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.saveToken(HttpSessionCsrfTokenRepository.java:57) at org.springframework.security.web.csrf.CsrfFilter$SaveOnAccessCsrfToken.saveTokenIfNecessary(CsrfFilter.java:219) at org.springframework.security.web.csrf.CsrfFilter$SaveOnAccessCsrfToken.getToken(CsrfFilter.java:177) at org.springframework.security.messaging.web.csrf.CsrfChannelInterceptor.preSend(CsrfChannelInterceptor.java:56) at org.springframework.messaging.support.AbstractMessageChannel$ChannelInterceptorChain.applyPreSend(AbstractMessageChannel.java:158) at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:113) ... 30 more Any ideas?

    Spring JIRA | 2 years ago | Bjorn Harvold
    org.springframework.messaging.MessageDeliveryException: Failed to send message to ExecutorSubscribableChannel[clientInboundChannel]; nested exception is java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Getting a nullpointer exception when switching displayables in J2ME

    Stack Overflow | 6 years ago | Pallinder
    java.lang.NullPointerException: 0 at javax.microedition.lcdui.Display$ChameleonTunnel.callScreenListener(), bci=46 at com.sun.midp.chameleon.layers.SoftButtonLayer.processCommand(), bci=74 at com.sun.midp.chameleon.layers.SoftButtonLayer.soft1(), bci=37 at com.sun.midp.chameleon.layers.SoftButtonLayer.keyInput(), bci=36 at com.sun.midp.chameleon.CWindow.keyInput(), bci=38 at javax.microedition.lcdui.Display$DisplayEventConsumerImpl.handleKeyEvent(), bci=17 at com.sun.midp.lcdui.DisplayEventListener.process(), bci=277 at com.sun.midp.events.EventQueue.run(), bci=179

    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.apache.catalina.connector.Request.parseCookies()
    2. Glassfish Core
      RequestFacade.getCookies
      1. org.apache.catalina.connector.Request.parseCookies(Request.java:2886)
      2. org.apache.catalina.connector.Request.convertCookies(Request.java:2901)
      3. org.apache.catalina.connector.Request.getCookies(Request.java:1930)
      4. org.apache.catalina.connector.RequestFacade.getCookies(RequestFacade.java:662)
      4 frames
    3. JavaServlet
      HttpServletRequestWrapper.getCookies
      1. javax.servlet.http.HttpServletRequestWrapper.getCookies(HttpServletRequestWrapper.java:69)
      2. javax.servlet.http.HttpServletRequestWrapper.getCookies(HttpServletRequestWrapper.java:69)
      2 frames
    4. org.springframework.session
      SessionRepositoryFilter$SessionRepositoryRequestWrapper.getSession
      1. org.springframework.session.web.http.CookieHttpSessionStrategy.getCookie(CookieHttpSessionStrategy.java:294)
      2. org.springframework.session.web.http.CookieHttpSessionStrategy.getSessionIds(CookieHttpSessionStrategy.java:310)
      3. org.springframework.session.web.http.CookieHttpSessionStrategy.getRequestedSessionId(CookieHttpSessionStrategy.java:165)
      4. org.springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.getRequestedSessionId(SessionRepositoryFilter.java:213)
      5. org.springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.getSession(SessionRepositoryFilter.java:188)
      6. org.springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.getSession(SessionRepositoryFilter.java:208)
      6 frames
    5. org.springframework.security
      CsrfChannelInterceptor.preSend
      1. org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.saveToken(HttpSessionCsrfTokenRepository.java:57)
      2. org.springframework.security.web.csrf.CsrfFilter$SaveOnAccessCsrfToken.saveTokenIfNecessary(CsrfFilter.java:219)
      3. org.springframework.security.web.csrf.CsrfFilter$SaveOnAccessCsrfToken.getToken(CsrfFilter.java:177)
      4. org.springframework.security.messaging.web.csrf.CsrfChannelInterceptor.preSend(CsrfChannelInterceptor.java:56)
      4 frames
    6. Spring Messaging
      AbstractMessageChannel.send
      1. org.springframework.messaging.support.AbstractMessageChannel$ChannelInterceptorChain.applyPreSend(AbstractMessageChannel.java:158)
      2. org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:113)
      3. org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:104)
      3 frames
    7. Spring WebSocket
      StandardWebSocketHandlerAdapter$3.onMessage
      1. org.springframework.web.socket.messaging.StompSubProtocolHandler.handleMessageFromClient(StompSubProtocolHandler.java:267)
      2. org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.handleMessage(SubProtocolWebSocketHandler.java:309)
      3. org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage(WebSocketHandlerDecorator.java:75)
      4. org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator.handleMessage(LoggingWebSocketHandlerDecorator.java:56)
      5. org.springframework.web.socket.handler.ExceptionWebSocketHandlerDecorator.handleMessage(ExceptionWebSocketHandlerDecorator.java:72)
      6. org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.delegateMessages(AbstractSockJsSession.java:385)
      7. org.springframework.web.socket.sockjs.transport.session.WebSocketServerSockJsSession.handleMessage(WebSocketServerSockJsSession.java:194)
      8. org.springframework.web.socket.sockjs.transport.handler.SockJsWebSocketHandler.handleTextMessage(SockJsWebSocketHandler.java:92)
      9. org.springframework.web.socket.handler.AbstractWebSocketHandler.handleMessage(AbstractWebSocketHandler.java:43)
      10. org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.handleTextMessage(StandardWebSocketHandlerAdapter.java:112)
      11. org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.access$000(StandardWebSocketHandlerAdapter.java:42)
      12. org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:82)
      13. org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:79)
      13 frames
    8. Tomcat WS
      WsHttpUpgradeHandler$WsReadListener.onDataAvailable
      1. org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:393)
      2. org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:494)
      3. org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:289)
      4. org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:130)
      5. org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:60)
      6. org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:203)
      6 frames
    9. org.apache.coyote
      AbstractProcessor.upgradeDispatch
      1. org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:194)
      2. org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:95)
      2 frames
    10. Grizzly HTTP
      NioEndpoint$SocketProcessor.run
      1. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:653)
      2. org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
      3. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)
      4. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513)
      4 frames
    11. Java RT
      ThreadPoolExecutor$Worker.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      2 frames
    12. Tomcat Util
      TaskThread$WrappingRunnable.run
      1. org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      1 frame
    13. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:744)
      1 frame