zoukankan      html  css  js  c++  java
  • Spring ActiveMQ Caused By: javax.jms.IllegalStateException: Connection closed

    根据 http://www.cnblogs.com/yshyee/p/7448808.html 进行JMS操作时,发送跟监听放到不同的项目中进行时,出现以下异常信息:

    org.springframework.jms.IllegalStateException: Connection closed; nested exception is javax.jms.IllegalStateException: Connection closed
            at org.springframework.jms.support.JmsUtils.convertJmsAccessException(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 log file for complete stacktrace
    Caused By: javax.jms.IllegalStateException: Connection closed
            at org.apache.activemq.jms.pool.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.$Proxy189.start(Unknown Source)
            Truncated. see log file for complete stacktrace

    解决方法:

    修改 amqConnectionFactory配置如下:

        <!-- ActiveMQ 连接工厂 -->
        <bean id="amqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
            <property name="brokerURL">
                <value>${amq.broker.url}</value>
            </property>
            <property name="userName">
                <value>${amq.username}</value>
            </property>
            <property name="password">
                <value>${amq.password}</value>
            </property>
        </bean>
  • 相关阅读:
    ansible——playbook conditions条件判断
    ansible——playbook lookups从插件加载变量
    ansible——playbook循环
    lombok注解
    集合与集合取笛卡尔积
    List排列组合
    synchronized初识
    java IO与NIO
    文件I/O和标准I/O
    双数据源配置
  • 原文地址:https://www.cnblogs.com/yshyee/p/7506235.html
Copyright © 2011-2022 走看看