Spring websocket с spring secuirty ExecutorSubscribeableChannel [clientInboundChannel] NULL вложенное исключение - PullRequest
0 голосов
/ 14 октября 2019

Я пытаюсь интегрировать websocket, чтобы иметь возможность отправлять уведомления от запланированного задания конкретным пользователям (независимо от того, на какой странице они находятся) Я должен признать, что материал довольно плотный, и я потерял время от времени, ноЯ следил за Энтони Раймондом, ответ и spring.io, руководство по веб-сокету ( github ) Мой код в значительной степени тот, который был найден в ответе с небольшими изменениями, ядобавили .setAllowedOrigins("*").withSockJS() в класс registerStompEndpoints , в класс WebSocketAuthenticationSecurityConfig я изменяю расширение на импменты (в среде IDE не разрешается использовать расширения) и, конечно, fetchUserFromDb дляпроверьте пользователя в моей БД, и я использую app.js, index.html из руководства spring.io.

Но когда я пытаюсь подключить websocket, я получаю следующую ошибку:

<<< ERROR
message:Failed to send message to ExecutorSubscribableChannel[clientInboundChannel]; nested exception is java.lang.NullPointerException
content-length:0
2019-10-14 16:46:36.919 DEBUG 11164 --- [http-nio-8080-exec-3] o.s.s.w.a.i.FilterSecurityInterceptor    : RunAsManager did not change Authentication object
2019-10-14 16:46:36.919 DEBUG 11164 --- [http-nio-8080-exec-3] o.s.security.web.FilterChainProxy        : /stomp/210/4b2whpi1/websocket reached end of additional filter chain; proceeding with original chain
2019-10-14 16:46:36.919 DEBUG 11164 --- [http-nio-8080-exec-3] org.apache.tomcat.util.http.Parameters   : Set encoding to UTF-8
2019-10-14 16:46:36.919 DEBUG 11164 --- [http-nio-8080-exec-3] o.s.web.servlet.DispatcherServlet        : GET "/app/stomp/210/4b2whpi1/websocket", parameters={}
2019-10-14 16:46:36.922 DEBUG 11164 --- [http-nio-8080-exec-3] o.s.w.s.s.s.WebSocketHandlerMapping      : Mapped to org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler@26888c31
2019-10-14 16:46:36.927 DEBUG 11164 --- [http-nio-8080-exec-3] o.s.w.s.s.t.h.DefaultSockJsService       : Processing transport request: GET http://localhost:8080/app/stomp/210/4b2whpi1/websocket
2019-10-14 16:46:36.950 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :     findClass(org.apache.tomcat.util.collections.LocalStrings)
2019-10-14 16:46:36.951 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :     --> Returning ClassNotFoundException
2019-10-14 16:46:36.951 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       : getResourceAsStream(org/apache/tomcat/util/collections/LocalStrings.properties)
2019-10-14 16:46:36.951 DEBUG 11164 --- [DefaultMessageListenerContainer-1] org.apache.activemq.ActiveMQSession      : ID:DESKTOP-UO1SML8-60101-1571067993609-4:1:1 Transaction Commit :null
2019-10-14 16:46:36.951 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Delegating to parent classloader sun.misc.Launcher$AppClassLoader@73d16e93
2019-10-14 16:46:36.951 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Searching local repositories
2019-10-14 16:46:36.952 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :   --> Resource not found, returning null
2019-10-14 16:46:36.952 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :     findClass(org.apache.tomcat.util.collections.LocalStrings_es)
2019-10-14 16:46:36.952 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :     --> Returning ClassNotFoundException
2019-10-14 16:46:36.953 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       : getResourceAsStream(org/apache/tomcat/util/collections/LocalStrings_es.properties)
2019-10-14 16:46:36.953 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Delegating to parent classloader sun.misc.Launcher$AppClassLoader@73d16e93
2019-10-14 16:46:36.953 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Searching local repositories
2019-10-14 16:46:36.953 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :   --> Resource not found, returning null
2019-10-14 16:46:36.954 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :     findClass(org.apache.tomcat.util.collections.LocalStrings_es_ES)
2019-10-14 16:46:36.954 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :     --> Returning ClassNotFoundException
2019-10-14 16:46:36.954 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       : getResourceAsStream(org/apache/tomcat/util/collections/LocalStrings_es_ES.properties)
2019-10-14 16:46:36.954 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Delegating to parent classloader sun.misc.Launcher$AppClassLoader@73d16e93
2019-10-14 16:46:36.955 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :   Searching local repositories
2019-10-14 16:46:36.955 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.loader.WebappClassLoaderBase       :   --> Resource not found, returning null
2019-10-14 16:46:36.958 DEBUG 11164 --- [http-nio-8080-exec-3] o.s.web.servlet.DispatcherServlet        : Completed 101 SWITCHING_PROTOCOLS
2019-10-14 16:46:36.958 DEBUG 11164 --- [http-nio-8080-exec-3] o.s.s.w.a.ExceptionTranslationFilter     : Chain processed normally
2019-10-14 16:46:36.958 DEBUG 11164 --- [http-nio-8080-exec-3] o.s.s.w.header.writers.HstsHeaderWriter  : Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@38885ea0
2019-10-14 16:46:36.958 DEBUG 11164 --- [http-nio-8080-exec-3] w.c.HttpSessionSecurityContextRepository : SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
2019-10-14 16:46:36.958 DEBUG 11164 --- [http-nio-8080-exec-3] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed
2019-10-14 16:46:36.959 DEBUG 11164 --- [http-nio-8080-exec-3] o.apache.coyote.http11.Http11Processor   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1a2721b0:org.apache.tomcat.util.net.NioChannel@14e0dd5c:java.nio.channels.SocketChannel[connected local=0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:60114]], Status in: [OPEN_READ], State out: [UPGRADING]
2019-10-14 16:46:36.966 DEBUG 11164 --- [http-nio-8080-exec-3] org.apache.tomcat.websocket.WsSession    : Created WebSocket session [0]
2019-10-14 16:46:36.971 DEBUG 11164 --- [http-nio-8080-exec-3] s.w.s.h.LoggingWebSocketHandlerDecorator : New WebSocketServerSockJsSession[id=4b2whpi1]
2019-10-14 16:46:36.984 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.t.websocket.server.WsFrameServer     : wsFrameServer.onDataAvailable
2019-10-14 16:46:36.984 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.tomcat.util.net.SocketWrapperBase    : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1a2721b0:org.apache.tomcat.util.net.NioChannel@14e0dd5c:java.nio.channels.SocketChannel[connected local=0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:60114]], Read from buffer: [0]
2019-10-14 16:46:36.984 DEBUG 11164 --- [http-nio-8080-exec-3] org.apache.tomcat.util.net.NioEndpoint   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1a2721b0:org.apache.tomcat.util.net.NioChannel@14e0dd5c:java.nio.channels.SocketChannel[connected local=0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:60114]], Read direct from socket: [68]
2019-10-14 16:46:36.984 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.t.websocket.server.WsFrameServer     : Read [68] bytes into input buffer ready for processing
2019-10-14 16:46:36.984 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.t.websocket.server.WsFrameServer     : WebSocket frame received. fin [true], rsv [4], OpCode [1], payload length [62]
2019-10-14 16:46:37.012 ERROR 11164 --- [http-nio-8080-exec-3] o.s.w.s.m.StompSubProtocolHandler        : Failed to send client message to application via MessageChannel in session 4b2whpi1. 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:146) ~[spring-messaging-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:122) ~[spring-messaging-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.messaging.StompSubProtocolHandler.handleMessageFromClient(StompSubProtocolHandler.java:292) ~[spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.handleMessage(SubProtocolWebSocketHandler.java:324) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage(WebSocketHandlerDecorator.java:75) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator.handleMessage(LoggingWebSocketHandlerDecorator.java:56) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.handler.ExceptionWebSocketHandlerDecorator.handleMessage(ExceptionWebSocketHandlerDecorator.java:58) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.delegateMessages(AbstractSockJsSession.java:386) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.sockjs.transport.session.WebSocketServerSockJsSession.handleMessage(WebSocketServerSockJsSession.java:195) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.sockjs.transport.handler.SockJsWebSocketHandler.handleTextMessage(SockJsWebSocketHandler.java:93) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.handler.AbstractWebSocketHandler.handleMessage(AbstractWebSocketHandler.java:43) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.handleTextMessage(StandardWebSocketHandlerAdapter.java:113) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.access$000(StandardWebSocketHandlerAdapter.java:42) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:84) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:81) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:395) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsFrameServer.sendMessageText(WsFrameServer.java:119) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:495) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:294) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:133) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:82) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsFrameServer.doOnDataAvailable(WsFrameServer.java:171) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsFrameServer.notifyDataAvailable(WsFrameServer.java:151) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:148) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:54) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:53) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_191]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_191]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]
Caused by: java.lang.NullPointerException: null
    at org.springframework.messaging.support.AbstractMessageChannel$ChannelInterceptorChain.applyPreSend(AbstractMessageChannel.java:178) ~[spring-messaging-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:132) ~[spring-messaging-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    ... 32 common frames omitted

2019-10-14 16:46:37.015 DEBUG 11164 --- [http-nio-8080-exec-3] s.w.s.s.t.s.WebSocketServerSockJsSession : Closing SockJS session 4b2whpi1 with CloseStatus[code=1002, reason=null]
2019-10-14 16:46:37.015 DEBUG 11164 --- [http-nio-8080-exec-3] o.s.w.s.adapter.NativeWebSocketSession   : Closing StandardWebSocketSession[id=3c7005ad-8334-65f4-6fde-07e36f4d59a8, uri=ws://localhost:8080/app/stomp/210/4b2whpi1/websocket]
2019-10-14 16:46:37.015 DEBUG 11164 --- [http-nio-8080-exec-3] org.apache.tomcat.websocket.WsSession    : Closing WebSocket session [0]
2019-10-14 16:46:37.015 DEBUG 11164 --- [http-nio-8080-exec-3] s.w.s.h.LoggingWebSocketHandlerDecorator : WebSocketServerSockJsSession[id=4b2whpi1] closed with CloseStatus[code=1002, reason=null]
2019-10-14 16:46:37.015 DEBUG 11164 --- [http-nio-8080-exec-3] o.s.w.s.m.SubProtocolWebSocketHandler    : Clearing session 4b2whpi1
2019-10-14 16:46:37.016 DEBUG 11164 --- [http-nio-8080-exec-3] o.s.m.s.b.SimpleBrokerMessageHandler     : Detected unsent DISCONNECT message. Processing anyway.
2019-10-14 16:46:37.017 DEBUG 11164 --- [http-nio-8080-exec-3] o.s.m.s.b.SimpleBrokerMessageHandler     : Processing DISCONNECT session=4b2whpi1
2019-10-14 16:46:37.022 DEBUG 11164 --- [clientOutboundChannel-1] o.s.w.s.m.SubProtocolWebSocketHandler    : No session for GenericMessage [payload=byte[0], headers={simpMessageType=DISCONNECT_ACK, simpDisconnectMessage=GenericMessage [payload=byte[0], headers={simpMessageType=DISCONNECT, stompCommand=DISCONNECT, simpSessionAttributes={org.springframework.messaging.simp.SimpAttributes.COMPLETED=true}, simpSessionId=4b2whpi1}], simpSessionId=4b2whpi1}]
2019-10-14 16:46:37.023  WARN 11164 --- [http-nio-8080-exec-3] w.s.h.ExceptionWebSocketHandlerDecorator : Unhandled exception after connection closed for ExceptionWebSocketHandlerDecorator [delegate=LoggingWebSocketHandlerDecorator [delegate=SubProtocolWebSocketHandler[StompSubProtocolHandler[v10.stomp, v11.stomp, v12.stomp]]]]

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:146) ~[spring-messaging-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:122) ~[spring-messaging-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.messaging.StompSubProtocolHandler.afterSessionEnded(StompSubProtocolHandler.java:619) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.clearSession(SubProtocolWebSocketHandler.java:516) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.afterConnectionClosed(SubProtocolWebSocketHandler.java:385) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.handler.WebSocketHandlerDecorator.afterConnectionClosed(WebSocketHandlerDecorator.java:85) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator.afterConnectionClosed(LoggingWebSocketHandlerDecorator.java:72) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.handler.ExceptionWebSocketHandlerDecorator.afterConnectionClosed(ExceptionWebSocketHandlerDecorator.java:78) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.close(AbstractSockJsSession.java:222) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.handler.WebSocketSessionDecorator.close(WebSocketSessionDecorator.java:160) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator.close(ConcurrentWebSocketSessionDecorator.java:252) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.messaging.StompSubProtocolHandler.sendErrorMessage(StompSubProtocolHandler.java:362) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.messaging.StompSubProtocolHandler.handleError(StompSubProtocolHandler.java:331) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.messaging.StompSubProtocolHandler.handleMessageFromClient(StompSubProtocolHandler.java:318) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.handleMessage(SubProtocolWebSocketHandler.java:324) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage(WebSocketHandlerDecorator.java:75) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator.handleMessage(LoggingWebSocketHandlerDecorator.java:56) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.handler.ExceptionWebSocketHandlerDecorator.handleMessage(ExceptionWebSocketHandlerDecorator.java:58) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.delegateMessages(AbstractSockJsSession.java:386) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.sockjs.transport.session.WebSocketServerSockJsSession.handleMessage(WebSocketServerSockJsSession.java:195) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.sockjs.transport.handler.SockJsWebSocketHandler.handleTextMessage(SockJsWebSocketHandler.java:93) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.handler.AbstractWebSocketHandler.handleMessage(AbstractWebSocketHandler.java:43) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.handleTextMessage(StandardWebSocketHandlerAdapter.java:113) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.access$000(StandardWebSocketHandlerAdapter.java:42) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:84) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:81) [spring-websocket-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:395) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsFrameServer.sendMessageText(WsFrameServer.java:119) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:495) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:294) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:133) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:82) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsFrameServer.doOnDataAvailable(WsFrameServer.java:171) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsFrameServer.notifyDataAvailable(WsFrameServer.java:151) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:148) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:54) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:53) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_191]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_191]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]
Caused by: java.lang.NullPointerException: null
    at org.springframework.messaging.support.AbstractMessageChannel$ChannelInterceptorChain.applyPreSend(AbstractMessageChannel.java:178) ~[spring-messaging-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:132) ~[spring-messaging-5.1.9.RELEASE.jar:5.1.9.RELEASE]
    ... 43 common frames omitted

2019-10-14 16:46:37.023 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.tomcat.util.net.SocketWrapperBase    : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1a2721b0:org.apache.tomcat.util.net.NioChannel@14e0dd5c:java.nio.channels.SocketChannel[connected local=0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:60114]], Read from buffer: [0]
2019-10-14 16:46:37.023 DEBUG 11164 --- [http-nio-8080-exec-3] org.apache.tomcat.util.net.NioEndpoint   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1a2721b0:org.apache.tomcat.util.net.NioChannel@14e0dd5c:java.nio.channels.SocketChannel[connected local=0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:60114]], Read direct from socket: [8]
2019-10-14 16:46:37.023 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.t.websocket.server.WsFrameServer     : Read [8] bytes into input buffer ready for processing
2019-10-14 16:46:37.023 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.t.websocket.server.WsFrameServer     : WebSocket frame received. fin [true], rsv [0], OpCode [8], payload length [2]
2019-10-14 16:46:37.024 DEBUG 11164 --- [http-nio-8080-exec-3] org.apache.tomcat.util.net.NioEndpoint   : Calling [org.apache.tomcat.util.net.NioEndpoint@244e619a].closeSocket([org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1a2721b0:org.apache.tomcat.util.net.NioChannel@14e0dd5c:java.nio.channels.SocketChannel[connected local=0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:60114]])

java.lang.Exception: null
    at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.doClose(NioEndpoint.java:1165) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.tomcat.util.net.SocketWrapperBase.close(SocketWrapperBase.java:394) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doClose(WsRemoteEndpointImplServer.java:223) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.close(WsRemoteEndpointImplBase.java:710) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:538) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.WsFrameBase.processDataControl(WsFrameBase.java:347) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:289) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:133) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:82) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsFrameServer.doOnDataAvailable(WsFrameServer.java:171) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsFrameServer.notifyDataAvailable(WsFrameServer.java:151) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:148) [tomcat-embed-websocket-9.0.24.jar:9.0.24]
    at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:54) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:53) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_191]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_191]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.24.jar:9.0.24]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]

2019-10-14 16:46:37.024 DEBUG 11164 --- [http-nio-8080-exec-3] o.apache.tomcat.util.threads.LimitLatch  : Counting down[http-nio-8080-exec-3] latch=5
2019-10-14 16:46:37.024 DEBUG 11164 --- [http-nio-8080-exec-3] o.a.c.h.u.UpgradeProcessorInternal       : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1a2721b0:Closed NioChannel], Status in: [OPEN_READ], State out: [CLOSED]```

PD: I will also appreciate if anyone know of a guide that indicates you how to display the notifications recived from websocket in any url, not only in the target one.
...