When a JMS operation is performed according to Http://www.cnblogs.com/yshyee/p/7448808.html, the following exception information occurs when the send and listen are placed in a different project:
org.springframework.jms.IllegalStateException:Connection closed; nested exception is Javax.jms.IllegalStateException:Connection closed at ORG.SPRINGFRAMEWORK.JMS.SUPPORT.JMSUTILS.CONVERTJMSACCESSEXC Eption (Jmsutils.java:279) at Org.springframework.jms.support.JmsAccessor.convertJmsAccessException (Jmsaccessor.java:169) at org.springframework.jms.core.JmsTemplate.executeLocal (Jmstemplate.java:987) at Org.springframework.jms.core.JmsTemplate.sendAndReceive (Jmstemplate.java:913) at Org.springframework.jms.core.JmsTemplate.sendAndReceive (Jmstemplate.java:904) truncated. See Logfile forComplete stacktracecaused By:javax.jms.IllegalStateException:Connection closed at Org.apache.activemq.jms.po Ol. Pooledconnection.assertnotclosed (Pooledconnection.java:206) at Org.apache.activemq.jms.pool.PooledConnection.start (Pooledconnection.java:94) at Org.springframework.jms.connection.singleconnectionfactory$sharedconnectioninvocationhandler.localstart (Singleconnectionfactory.java:632) at Org.springframework.jms.connection.singleconnectionfactory$sharedconnectioninvocationhandler.invoke ( Singleconnectionfactory.java:569) at Com.sun.proxy. $Proxy 189.start (Unknown Source) truncated. See Logfile forComplete StackTrace
Workaround:
Modify the Amqconnectionfactory configuration as follows:
<!--ActiveMQ Connection Factory - <BeanID= "Amqconnectionfactory"class= "Org.apache.activemq.ActiveMQConnectionFactory"> < Propertyname= "Brokerurl"> <value>${amq.broker.url}</value> </ Property> < Propertyname= "UserName"> <value>${amq.username}</value> </ Property> < Propertyname= "Password"> <value>${amq.password}</value> </ Property> </Bean>
Spring ActiveMQ caused By:javax.jms.IllegalStateException:Connection closed