您的位置:首页 > 编程语言 > Java开发

使用SpringBoot整合ActiveMQ自动注入JmsMessagingTemplate时候的问题

2020-02-02 05:41 906 查看

使用SpringBoot整合ActiveMQ自动注入JmsMessagingTemplate时候的问题

APPLICATION FAILED TO START

Description:

Field template in com.springboot.chapter7.service.imp.ProducerSericeImp 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.

我看了一个博主的不知道他的错误是不是和我一样,但是我用他的方法可以改了之后就好了,我的springboot版本的2.2.1

<!-- 整合消息队列ActiveMQ -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
<!-- 如果配置线程池则加入 -->
就是这个我一开始在网上找的然后不行,后来把这个注释后使用下面的就可以了
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>
</dependency>
<!--<dependency>
<groupId>org.messaginghub</groupId>
<artifactId>pooled-jms</artifactId>
</dependency>-->

希望帮助到后来的同学
原文博客.

  • 点赞
  • 收藏
  • 分享
  • 文章举报
小文不加刘 发布了1 篇原创文章 · 获赞 0 · 访问量 18 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐