Spring ActiveMQ caused By:javax.jms.IllegalStateException:Connection closed

Source: Internet
Author: User
Tags truncated amq

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.