JmsTemplate.convertAndSend throws NullPointerException during shutdown #29706
Labels
in: messaging
Issues in messaging modules (jms, messaging)
status: backported
An issue that has been backported to maintenance branches
type: enhancement
A general enhancement
Milestone
On a web application using Spring 5.2.x the following is showing up in the log files:
The code that explains what is going on at a high level is JmsTemplate::execute. That code shows that the connection created by the assigned connection factory returned a null connection instead of throwing JMSException. The API contract for JmsTemplate::execute states "throws JmsException if there is any problem" but that is not true if the connection factory returned null instead of throwing
JMSException
.While the root cause is the broken
ConnectionFactory
implementation, I think this code could be improved a bit by:conToClose
prior to creating a session.This issue is a low priority as these errors only occur during a shutdown of the application so impact of this issue is trivial. It just produces a confusing message in the logs.
The text was updated successfully, but these errors were encountered: