spring整合activemq问题小结
2017-09-30 15:35
363 查看
1.通配符的匹配很全面, 但无法找到元素 ‘amq:connectionFactory’
在activemq.xml文件里有配置
目前不清楚该怎么改,只是换了一种写法
2.类型转换错误:
Error creating bean with name ‘redisTemplate’ defined in URL [file:/F:/Java/workspace/user-project/user-app/target/classes/spring-redis-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type ‘org.apache.activemq.spring.ActiveMQConnectionFactory’ to required type ‘org.springframework.data.redis.connection.RedisConnectionFactory’ for property ‘connectionFactory’; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.apache.activemq.spring.ActiveMQConnectionFactory] to required type [org.springframework.data.redis.connection.RedisConnectionFactory] for property ‘connectionFactory’: no matching editors or conversion strategy found
原因:在redis配置中也用到了connectionFactory,所以这里的connectionFactory改名为mqConnectionFactory即可。如1中所示
在activemq.xml文件里有配置
<amq:connectionFactory id="amqConnectionFactory" brokerURL="tcp://localhost:61616" userName="admin" password="admin" /> --> <!-- <amq:connectionFactory id="amqConnectionFactory" brokerURL="tcp://localhost:61616" userName="admin" password="admin"/> --> <!-- 配置JMS连接工长 --> <bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory"> <property name = "brokerURL" ref="amqConnectionFactory"/> <property name="sessionCacheSize" value="100" /> </bean>
目前不清楚该怎么改,只是换了一种写法
<bean id="mqConnectionFactory" class="org.apache.activemq.spring.ActiveMQConnectionFactory"> <property name = "brokerURL" value="tcp://localhost:61616" /> </bean>
2.类型转换错误:
Error creating bean with name ‘redisTemplate’ defined in URL [file:/F:/Java/workspace/user-project/user-app/target/classes/spring-redis-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type ‘org.apache.activemq.spring.ActiveMQConnectionFactory’ to required type ‘org.springframework.data.redis.connection.RedisConnectionFactory’ for property ‘connectionFactory’; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.apache.activemq.spring.ActiveMQConnectionFactory] to required type [org.springframework.data.redis.connection.RedisConnectionFactory] for property ‘connectionFactory’: no matching editors or conversion strategy found
原因:在redis配置中也用到了connectionFactory,所以这里的connectionFactory改名为mqConnectionFactory即可。如1中所示
相关文章推荐
- CXF 整合 Spring 遇到的问题(小结)
- Spring2.5,Activemq5.2整合遇到的问题以及解决方法
- Spring Boot 整合Spring Security 和Swagger2 遇到的问题小结
- Spring2.5整合ActiveMQ 5.2(P2P文本消息)
- spring boot 整合shiro 配置类报错问题
- ActiveMQ在spring中整合实例讲解
- spring整合activemq发送MQ消息[queue模式]实例
- spring整合activemq发送MQ消息[Topic模式]实例
- spring和hibernate整合遇到的问题
- spring整合quartz注入service的及动态任务处理问题
- spring_SSH整合之_三个常见问题
- Spring Boot整合Activiti,查看流程图出现中文乱码问题
- mybatis整合spring、springmvc时业务层无法进行事务回滚问题解决
- Spring+SpringMvc+Hibernate整合问题
- CXF整合spring部署问题
- Spring整合JMS——基于ActiveMQ实现
- Spring整合activeMQ
- activeMq整合spring
- 深入浅出JMS(四)--Spring和ActiveMQ整合的完整实例
- ActiveMQ、Spring整合学习