java.lang.NullPointerException: null

Spring JIRA | Pierre Fouché | 3 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

    See the stack trace below. This happen when sending an incorrect STOMP command (eg "FOO") with no payload. In that case, the StompDecoder returns a null decoded message, causing the NPE. {noformat} java.lang.NullPointerException: null at org.springframework.web.socket.messaging.StompSubProtocolHandler.handleMessageFromClient(StompSubProtocolHandler.java:127) ~[spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.handleMessage(SubProtocolWebSocketHandler.java:233) [spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage(WebSocketHandlerDecorator.java:59) [spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator.handleMessage(LoggingWebSocketHandlerDecorator.java:55) [spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.socket.handler.ExceptionWebSocketHandlerDecorator.handleMessage(ExceptionWebSocketHandlerDecorator.java:69) [spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.socket.adapter.jetty.JettyWebSocketHandlerAdapter.onWebSocketText(JettyWebSocketHandlerAdapter.java:77) [spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE] at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45] at org.eclipse.jetty.websocket.common.events.annotated.CallableMethod.call(CallableMethod.java:71) [websocket-common-9.1.0.v20131115.jar:9.1.0.v20131115] at org.eclipse.jetty.websocket.common.events.annotated.OptionalSessionCallableMethod.call(OptionalSessionCallableMethod.java:72) [websocket-common-9.1.0.v20131115.jar:9.1.0.v20131115] {noformat}

    Spring JIRA | 3 years ago | Pierre Fouché
    java.lang.NullPointerException: null
  2. 0

    See the stack trace below. This happen when sending an incorrect STOMP command (eg "FOO") with no payload. In that case, the StompDecoder returns a null decoded message, causing the NPE. {noformat} java.lang.NullPointerException: null at org.springframework.web.socket.messaging.StompSubProtocolHandler.handleMessageFromClient(StompSubProtocolHandler.java:127) ~[spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.handleMessage(SubProtocolWebSocketHandler.java:233) [spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage(WebSocketHandlerDecorator.java:59) [spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator.handleMessage(LoggingWebSocketHandlerDecorator.java:55) [spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.socket.handler.ExceptionWebSocketHandlerDecorator.handleMessage(ExceptionWebSocketHandlerDecorator.java:69) [spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.socket.adapter.jetty.JettyWebSocketHandlerAdapter.onWebSocketText(JettyWebSocketHandlerAdapter.java:77) [spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE] at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45] at org.eclipse.jetty.websocket.common.events.annotated.CallableMethod.call(CallableMethod.java:71) [websocket-common-9.1.0.v20131115.jar:9.1.0.v20131115] at org.eclipse.jetty.websocket.common.events.annotated.OptionalSessionCallableMethod.call(OptionalSessionCallableMethod.java:72) [websocket-common-9.1.0.v20131115.jar:9.1.0.v20131115] {noformat}

    Spring JIRA | 3 years ago | Pierre Fouché
    java.lang.NullPointerException: null

    Root Cause Analysis

    1. java.lang.NullPointerException

      null

      at org.springframework.web.socket.messaging.StompSubProtocolHandler.handleMessageFromClient()
    2. Spring WebSocket
      JettyWebSocketHandlerAdapter.onWebSocketText
      1. org.springframework.web.socket.messaging.StompSubProtocolHandler.handleMessageFromClient(StompSubProtocolHandler.java:127)[spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE]
      2. org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.handleMessage(SubProtocolWebSocketHandler.java:233)[spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE]
      3. org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage(WebSocketHandlerDecorator.java:59)[spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE]
      4. org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator.handleMessage(LoggingWebSocketHandlerDecorator.java:55)[spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE]
      5. org.springframework.web.socket.handler.ExceptionWebSocketHandlerDecorator.handleMessage(ExceptionWebSocketHandlerDecorator.java:69)[spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE]
      6. org.springframework.web.socket.adapter.jetty.JettyWebSocketHandlerAdapter.onWebSocketText(JettyWebSocketHandlerAdapter.java:77)[spring-websocket-4.0.0.RELEASE.jar:4.0.0.RELEASE]
      6 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)[na:na]
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_45]
      3. java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_45]
      3 frames
    4. Jetty
      OptionalSessionCallableMethod.call
      1. org.eclipse.jetty.websocket.common.events.annotated.CallableMethod.call(CallableMethod.java:71)[websocket-common-9.1.0.v20131115.jar:9.1.0.v20131115]
      2. org.eclipse.jetty.websocket.common.events.annotated.OptionalSessionCallableMethod.call(OptionalSessionCallableMethod.java:72)[websocket-common-9.1.0.v20131115.jar:9.1.0.v20131115]
      2 frames