Skip to content

The NullPointerException occur when stomp client unsubscribing [SPR-11838] #16457

@spring-projects-issues

Description

@spring-projects-issues

Serhii Marchuk opened SPR-11838 and commented

When stomp client sends unsubscribe command the NullPointerException occurs in DefaultSubscriptionRegistry.

Stack trace and log example:
aa DEBUG org.springframework.messaging.simp.stomp.StompDecoder: Decoded [Payload byte[0]][Headers={stompCommand=UNSUBSCRIBE, nativeHeaders={id=[/topic/name.100]}, simpMessageType=UNSUBSCRIBE, simpSubscriptionId=/topic/name.100, id=7ead5193-cfdc-94f7-8571-6a0721ee2226, timestamp=1401467621119}]
aa DEBUG org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry: Unubscribe request: [Payload byte[0]][Headers={stompCommand=UNSUBSCRIBE, nativeHeaders={id=[/topic/name.100]}, simpMessageType=UNSUBSCRIBE, simpSessionAttributes={}, simpSubscriptionId=/topic/name.100, simpSessionId=s2i37nxt, id=2f7bd8d9-1cfb-b635-ea67-661f078f69f7, timestamp=1401467621119}]
aa DEBUG org.springframework.messaging.simp.stomp.StompDecoder: Decoded [Payload byte[0]][Headers={stompCommand=UNSUBSCRIBE, nativeHeaders={id=[/topic/name.]}, simpMessageType=UNSUBSCRIBE, simpSubscriptionId=/topic/name.*, id=00039d49-3fc4-fd23-f006-6a2e4cd01dc9, timestamp=1401467621119}]
aa DEBUG org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry: Unubscribe request: [Payload byte[0]][Headers={stompCommand=UNSUBSCRIBE, nativeHeaders={id=[/topic/name.
]}, simpMessageType=UNSUBSCRIBE, simpSessionAttributes={}, simpSubscriptionId=/topic/name.*, simpSessionId=s2i37nxt, id=9ed66ecc-4c0d-d59c-8458-4285dd630831, timestamp=1401467621119}]
Exception in thread "clientInboundChannel-5" java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:333)
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:988)
at org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry$SessionSubscriptionInfo.getSubscriptions(DefaultSubscriptionRegistry.java:315)
at org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry.removeSubscriptionInternal(DefaultSubscriptionRegistry.java:98)
at org.springframework.messaging.simp.broker.AbstractSubscriptionRegistry.unregisterSubscription(AbstractSubscriptionRegistry.java:91)
at org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler.handleMessageInternal(SimpleBrokerMessageHandler.java:129)
at org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.handleMessage(AbstractBrokerMessageHandler.java:177)
at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
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 "clientInboundChannel-2" java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:333)
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:988)
at org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry$SessionSubscriptionInfo.getSubscriptions(DefaultSubscriptionRegistry.java:315)
at org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry.removeSubscriptionInternal(DefaultSubscriptionRegistry.java:98)
at org.springframework.messaging.simp.broker.AbstractSubscriptionRegistry.unregisterSubscription(AbstractSubscriptionRegistry.java:91)
at org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler.handleMessageInternal(SimpleBrokerMessageHandler.java:129)
at org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.handleMessage(AbstractBrokerMessageHandler.java:177)
at org.springframework.messaging.support.ExecutorSubscribableChannel$1.run(ExecutorSubscribableChannel.java:70)
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)


Affects: 4.0.5

Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions