Skip to content

NullPointerException can occur from JmsUtils.buildException [SPR-6052] #10721

Closed
@spring-projects-issues

Description

@spring-projects-issues

John Baker opened SPR-6052 and commented

The following exception has been noted when the WL JMS drivers failed to connect:

Exception in thread "jms.jobs.messageListenerContainer.SRUpdateFromSiebel-1" java.lang.NullPointerException
at java.lang.String.indexOf(String.java:1564)
at java.lang.String.indexOf(String.java:1546)
at org.springframework.jms.support.JmsUtils.buildExceptionMessage(JmsUtils.java:255)
at org.springframework.jms.listener.DefaultMessageListenerContainer.handleListenerSetupFailure(DefaultMessageListenerContainer.java:745)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:897)
at java.lang.Thread.run(Thread.java:595)

The problem is this line of code in JmsUtils.buildException:

if (linkedEx != null && message.indexOf(linkedEx.getMessage()) == -1) {

linkedEx may not be null, but the message can be null, so it simply need to be:

if (linkedEx != null && linkedEx.getMessage() != null && message.indexOf(linkedEx.getMessage()) == -1) {

Affects: 2.5.6

Issue Links:

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)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