Skip to content

SimpAnnotationMethodMessageHandler fails when no applicationDestinationPrefixes configured or Rabbit endpoint present [SPR-13704] #18279

@spring-projects-issues

Description

@spring-projects-issues

Juliusz Piwoński opened SPR-13704 and commented

There is unguarded access to first iterator element at: SimpAnnotationMethodMessageHandler.handleMatch
which causes NoSuchElementException in case no org.springframework.messaging.simp.config.MessageBrokerRegistry#setApplicationDestinationPrefixes is set.

Caused by: java.util.NoSuchElementException
	at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:713)
	at java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:734)
	at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1042)
	at org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler.handleMatch(SimpAnnotationMethodMessageHandler.java:471)
	at org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler.handleMatch(SimpAnnotationMethodMessageHandler.java:86)
	at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMessageInternal(AbstractMethodMessageHandler.java:426)
	at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMessage(AbstractMethodMessageHandler.java:364)
	at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:135)
	... 3 more

Affects: 4.1.8, 4.2.3

Referenced from: commits 5549436, 4b27a6d, f119962, e8417ea

Backported to: 4.1.9

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions