org.springframework.messaging.MessageDeliveryException: Failed to handle GenericMessage [payload=byte[0], headers={simpMessageType=DISCONNECT, stompCommand=DISCONNECT, simpSessionAttributes={org.springframework.messaging.simp.SimpAttributes.COMPLETED=true}, simpSessionId=e4fb909754d849a08526503c2afa7584}] to org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask@329d23a5 in StompBrokerRelay[127.0.0.1:61613]; nested exception is java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • This is the exception on server {code} Exception in thread "clientInboundChannel-97" org.springframework.messaging.MessageDeliveryException: Failed to handle GenericMessage [payload=byte[0], headers={simpMessageType=DISCONNECT, stompCommand=DISCONNECT, simpSessionAttributes={org.springframework.messaging.simp.SimpAttributes.COMPLETED=true}, simpSessionId=e4fb909754d849a08526503c2afa7584}] to org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask@329d23a5 in StompBrokerRelay[127.0.0.1:61613]; nested exception is java.lang.NullPointerException at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:144) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler$StompConnectionHandler.forward(StompBrokerRelayMessageHandler.java:783) at org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler.handleMessageInternal(StompBrokerRelayMessageHandler.java:511) at org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.handleMessage(AbstractBrokerMessageHandler.java:238) at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:135) ... 3 more {code} Here is the client side code: {code:java} void setup() throws ExecutionException, InterruptedException { JettyWebSocketClient webSocketClient = new JettyWebSocketClient(); List<Transport> transports = new ArrayList<Transport>(1); transports.add(new WebSocketTransport(webSocketClient)); SockJsClient sockJsClient = new SockJsClient(transports); sockJsClient.setMessageCodec(new StringMessageCodec()); stompClient = new WebSocketStompClient(sockJsClient); stompClient.setMessageConverter(new StringMessageConverter()); stompClient.start(); sessionHandler = new MyStompSessionHandler(); stompClient.connect(WS_URL, sessionHandler); } void stop() { stompSession.disconnect(); stompClient.stop(); } {code} As you can see the client closes the connection gracefully. It first disconnects the session and then calls stop() on the stompClient. Doing so should not result in an exception on the server.
    via by Prashant Deva,
    • org.springframework.messaging.MessageDeliveryException: Failed to handle GenericMessage [payload=byte[0], headers={simpMessageType=DISCONNECT, stompCommand=DISCONNECT, simpSessionAttributes={org.springframework.messaging.simp.SimpAttributes.COMPLETED=true}, simpSessionId=e4fb909754d849a08526503c2afa7584}] to org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask@329d23a5 in StompBrokerRelay[127.0.0.1:61613]; nested exception is java.lang.NullPointerException at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:144) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler$StompConnectionHandler.forward(StompBrokerRelayMessageHandler.java:783) at org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler.handleMessageInternal(StompBrokerRelayMessageHandler.java:511) at org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.handleMessage(AbstractBrokerMessageHandler.java:238) at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:135) ... 3 more
    No Bugmate found.