JmsMessagingTemplate注入失败问题

一、问题原因:

在整合springboot+activeMQ时,出现JmsMessagingTemplate注入失败问题:

文字:

Description:

Field jmsMessagingTemplate in com.it.activemq.activemq.service.impl.ProducerServiceImpl required a bean of type 'org.springframework.jms.core.JmsMessagingTemplate' that could not be found.

The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Autowired(required=true)

The following candidates were found but could not be injected:
    - Bean method 'jmsMessagingTemplate' in 'JmsAutoConfiguration.MessagingTemplateConfiguration' not loaded because Ancestor org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration did not match


Action:

Consider revisiting the entries above or defining a bean of type 'org.springframework.jms.core.JmsMessagingTemplate' in your configuration.

二、解决方法

1、检查配置文件末尾是否存在空格,如果存在,请删除

2、在pom.xml文件中添加依赖:

<dependency>
		<groupId>org.messaginghub</groupId>
		<artifactId>pooled-jms</artifactId>
		<version>1.0.4</version>
</dependency>
 

三、产生问题原因:

在springboot2.0以下版本,需要添加的Maven依赖包为:

<dependency>
 		<groupId>org.apache.activemq</groupId>
		<artifactId>activemq-pool</artifactId>
</dependency>

如何是springboot2.0以上版本,需要添加的Maven依赖包为:

<dependency>
	<groupId>org.messaginghub</groupId>
	<artifactId>pooled-jms</artifactId>
	<version>1.0.4</version>
</dependency>

 

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值