Skip to content

NullPointerException in DefaultSubscriptionRegistry.removeSubscription [SPR-13205] #17797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Jul 7, 2015 · 1 comment
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jul 7, 2015

Henrik Olsson opened SPR-13205 and commented

Exception in thread "clientInboundChannel-2" org.springframework.messaging.MessageDeliveryException: Failed to handle GenericMessage [payload=byte[0], headers={simpMessageType=UNSUBSCRIBE, stompCommand=UNSUBSCRIBE, nativeHeaders={id=[/api/en/stuff/7839]}, simpSessionAttributes={scopedTarget.scopedRequestsPerSessionCounter=com.mobenga.ngen.socket.session.ScopedRequestsPerSessionCounter@680b5ef0, org.springframework.messaging.simp.SimpAttributes.DESTRUCTION_CALLBACK.scopedTarget.scopedRequestsPerSessionCounter=org.springframework.beans.factory.support.DisposableBeanAdapter@2f8c0ae0}, simpSubscriptionId=/api/en/stuff/7839, simpSessionId=tj3eu5ly}] to org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask@2288647f in SimpleBroker[DefaultSubscriptionRegistry[cache[281 destination(s)], registry[284 sessions]]]; 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.broker.DefaultSubscriptionRegistry$SessionSubscriptionInfo.removeSubscription(DefaultSubscriptionRegistry.java:330)
	at org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry.removeSubscriptionInternal(DefaultSubscriptionRegistry.java:99)
	at org.springframework.messaging.simp.broker.AbstractSubscriptionRegistry.unregisterSubscription(AbstractSubscriptionRegistry.java:83)
	at org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler.handleMessageInternal(SimpleBrokerMessageHandler.java:177)
	at org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.handleMessage(AbstractBrokerMessageHandler.java:238)
	at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:135)
	... 3 more

Affects: 4.1.6

Issue Links:

Referenced from: commits f79a5c1, 4fbf6a3

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Fixed through not-null checks for the subscription Sets, for cases where the last subscription has been removed right inbetween a keySet() call and a subsequent get(key) check...

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging Issues in messaging modules (jms, messaging) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants