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:)
at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:)
at org.springframework.jms.core.JmsTemplate.executeLocal(JmsTemplate.java:)
at org.springframework.jms.core.JmsTemplate.sendAndReceive(JmsTemplate.java:)
at org.springframework.jms.core.JmsTemplate.sendAndReceive(JmsTemplate.java:)
Truncated. see log file for complete stacktrace
Caused By: javax.jms.IllegalStateException: Connection closed
at org.apache.activemq.jms.pool.PooledConnection.assertNotClosed(PooledConnection.java:)
at org.apache.activemq.jms.pool.PooledConnection.start(PooledConnection.java:)
at org.springframework.jms.connection.SingleConnectionFactory$SharedConnectionInvocationHandler.localStart(SingleConnectionFactory.java:)
at org.springframework.jms.connection.SingleConnectionFactory$SharedConnectionInvocationHandler.invoke(SingleConnectionFactory.java:)
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>
Spring ActiveMQ Caused By: javax.jms.IllegalStateException: Connection closed的更多相关文章
- 基于Maven,Spring+ActiveMQ实现,贴近实际
本文只实现了Topic,queue改点配置就行了 一.pom依赖 Spring的太长了,具体可以看下面源码里面 <dependency> <groupId>org.apache ...
- ActiveMQ持久化机制和JMS可靠消息
1.ActiveMQ持久化机制 1.1 JDBC将数据持久化到数据库 1.2 AMQ生成日志文件 1.3 KahaDB:本次磁盘生成数据文件(默认) 1.4 LevelDB:谷歌K/V数据库 1.5 ...
- ActiveMQ——activemq的报错见解javax.jms.JMSException: Software caused connection abort: recv failed
activeMQ出现javax.jms.JMSException: Software caused connection abort: recv failed的问题解决 一直找不到原因,原来是在本地的 ...
- ActiveMQ学习笔记(二) JMS与Spring
上文可见,JMS Native API使用起来不是特别方便.好在Spring提供了很好的JMS支持. (一)配置ConnectionFactory 如果使用连接池的话,不要忘记activemq-poo ...
- Caused by: java.lang.IllegalStateException: javax.websocket.server.ServerContainer not available
java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.co ...
- 【spring boot】【elasticsearch】spring boot整合elasticsearch,启动报错Caused by: java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8
spring boot整合elasticsearch, 启动报错: Caused by: java.lang.IllegalStateException: availableProcessors ], ...
- cloudera-scm-server启动时出现Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection问题解决方法(图文详解)
问题现象 查看 [root@cmbigdata1 cloudera-scm-server]# pwd /var/log/cloudera-scm-server [root@cmbigdata1 clo ...
- Caused by: java.lang.NoClassDefFoundError: javax/jms/Message报错
Caused by: java.lang.NoClassDefFoundError: javax/jms/Message at java.lang.Class.getDeclaredMethods0( ...
- 【spring data jpa】报错如下:Caused by: javax.persistence.EntityNotFoundException: Unable to find com.rollong.chinatower.server.persistence.entity.staff.Department with id 0
报错如下: org.springframework.orm.jpa.JpaObjectRetrievalFailureException: Unable to find com.rollong.chi ...
随机推荐
- hibernate 注解 联合主键映射
联合主键用Hibernate注解映射方式主要有三种: 第一.将联合主键的字段单独放在一个类中,该类需要实现java.io.Serializable接口并重写equals和hascode,再将 该类注解 ...
- centos7安装debuginfo
转自:https://www.72zk.com/show/blog/20 查看内核版本,查找对应的内核rpm文件 [root@localhost ~]#uname -rsp Linux 3.10.0- ...
- source insight设置tab键为4个空格
首先通过路径(Options->Document Options)进入以下界面: step 1:将 Visible tabs 打勾. step 2 :将 Expand Tabs 打勾. step ...
- android获取屏幕长宽的方法
package com.kale.imageview02; import android.annotation.SuppressLint; import android.app.Activity; i ...
- How to delete team project from TFS visual studio ?
/* Author: Jiangong SUN */ To delete team project from TFS Visual Studio, you need to use "TFSD ...
- 使用Git Submodule管理子模块
转自:https://segmentfault.com/a/1190000003076028 使用场景 基于公司的项目会越来越多,常常需要提取一个公共的类库提供给多个项目使用,但是这个library怎 ...
- adb 环境配置 常用命令 总结
配置环境变量 右键我的电脑 -> 属性 -> 高级 -> 环境变量 -> Path 在Path中添加Android SDK安装路径中 adb.exe 的路径,例如[\sdk\p ...
- windows10-64位安装OpenSSL详细教程(转载)
相关软件下载地址: 1.ActivePerl 5.26.1:https://www.activestate.com/activeperl/downloads 2.openssl-1.1.0g:http ...
- 【Java】Java-fastjson-基本使用方法
Java-fastjson-基本使用方法 fastjson maven_百度搜索 Maven Repository: com.alibaba » fastjson » 1.2.44 fastjson ...
- tensoflow数据读取
数据读取 TensorFlow程序读取数据一共有3种方法: 供给数据(Feeding): 在TensorFlow程序运行的每一步, 让Python代码来供给数据. 从文件读取数据: 在TensorFl ...