【ActiveMQ】消息生产者自动注入报错:Could not autowire. No beans of 'JmsMessagingTemplate' type found
标签:public style hat and 报错 require core ota ati
使用ActiveMQ过程中,定义消息生产者:
package com.sxd.jms.producer;import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jms.core.JmsMessagingTemplate; import org.springframework.stereotype.Service;import javax.jms.Destination;@Service("producer") public class Producer1 {@Autowired // 也可以注入JmsTemplate,JmsMessagingTemplate对JmsTemplate进行了封装private JmsMessagingTemplate jmsTemplate;// 发送消息,destination是发送到的队列,message是待发送的消息public void sendMessage(Destination destination, final String message){jmsTemplate.convertAndSend(destination, message);}}
View Code
但是IDE报错:
启动编译,依旧是报错:
Description:Field jmsTemplate in com.sxd.jms.producer.Producer1 required a bean of type ‘org.springframework.jms.core.JmsMessagingTemplate‘ that could not be found.- Bean method ‘jmsMessagingTemplate‘ not loaded because Ancestor org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration did not matchAction:Consider revisiting the conditions above or defining a bean of type ‘org.springframework.jms.core.JmsMessagingTemplate‘ in your configuration.
解决方式:
因为application.properties中配置ActiveMQ的相关配置后面有空格:
把配置后面的空格去掉。保存,重新编译。
解决了!!!!
【ActiveMQ】消息生产者自动注入报错:Could not autowire. No beans of 'JmsMessagingTemplate' type found
标签:public style hat and 报错 require core ota ati
原文地址:http://www.cnblogs.com/sxdcgaq8080/p/7920560.html
【ActiveMQ】消息生产者自动注入报错:Could not autowire. No beans of 'JmsMessagingTemplate' type found相关推荐
- 【ActiveMQ】消息生产者自动注入报错:Could not autowire. No beans of 'JmsMessagingTemplate' type found...
使用ActiveMQ过程中,定义消息生产者: package com.sxd.jms.producer;import org.springframework.beans.factory.annotat ...
- 使用 @Resource或@Autowire时 Idea报错Could not autowire. No beans of 'xxxService' type found. more..出现红色波浪线
原博客:https://blog.csdn.net/qq_36802726/article/details/84026031 错误: 使用注解@Resource或者@Autowire intelli ...
- Java--使用@Autowired报错Could not autowire. No beans of ‘XX‘ type found.
使用@Autowired时报错如下: Could not autowire. No beans of 'XXXX' type found. 1.检查下导入对象类的路径:注入的时候,导入的对象类路径不对 ...
- IDEA 报 「Could not autowire. No beans of ‘UserMapper‘ type found」错误解决方案
IDEA 报 「Could not autowire. No beans of 'UserMapper' type found」错误解决方案 参考文章: (1)IDEA 报 「Could not au ...
- SQL注入-盲注-时间注入-报错注入-布尔盲注-DNSlog注入-宽字节注入-WAF绕过-SqlMap使用
Sqli-labs的安装 1.安装WAMP http://www.wampserver.com/ WAMP是php + mysql + Apache环境集成工具 2.下载Sqli-labs https ...
- 解决非controller使用@Autowired注解注入报错为java.lang.NullPointerException问题
解决非controller使用@Autowired注解注入报错为java.lang.NullPointerException问题 参考文章: (1)解决非controller使用@Autowired注 ...
- SQLi LABS Less 27 联合注入+报错注入+布尔盲注+时间盲注
第27关是单引号字符型注入: 过滤了注释(/* -- #),关键字(select union),空格: 这篇文章提供联合注入.报错注入.布尔盲注.时间盲注四种解题方式. 其他 SQLi LABS 靶场 ...
- SQLi LABS Less-26 联合注入+报错注入+布尔盲注+时间盲注
第26关是单引号字符型注入: 后台过滤了关键字( and or ),注释(/* # -- /),空格: 这篇文章提供联合注入.报错注入.布尔盲注.时间盲注四种解题方式. 目录 一.功能分析 二 ...
- SQLi LABS Less 25 联合注入+报错注入+布尔盲注
第二十五关单引号字符型注入: 过滤了关键字(and.or),可以使用双写绕过: 这篇文章提供了联合注入.报错注入.布尔盲注三种解题方法. SQLi LABS 其余关卡可参考我的专栏:SQLi-LABS ...
最新文章
- c#使用正则表达式获取TR中的多个TD_一个 Vue 模板可以有多个根节点(Fragments)?
- python能在生活中做什么-python能做哪些生活有趣的事情
- window中osmnx包的详细安装过程
- 如何在运行时打印出 SAP Spartacus 配置(config)信息
- Python笔记-centos7使用adb连接真实手机及初始化uiautomatro2项目
- 用Nikto探测一个网站所用到的技术
- boost::filesystem::directory_iterator() 出现段错误 Sementation fault
- Day13 - Ruby比一比: instance_eval 和 class_eval方法
- 2022年8月Python小屋编程比赛获奖名单(送5本书)
- 谈谈我在创业公司的感悟
- Java8 CompletableFuture(2)回调函数 thenApply thenAccept thenRun
- ios7 未能连接到服务器,完美解决iTunes 未能连接到此 iPhone。发生未知错误(0xe8000003)和0xe8000084...
- “值得”关注公司:我们应该向优衣库学习什么?
- 《天龙八部》地形研究-1
- 网站判断是否是苹果系统和使用微信浏览器
- Java与PHP之争
- IC设计行业都有哪些不错的公司(外企篇)
- 数据结构与算法——中缀表达式转后缀表达式
- 插曲一下:很多程序员会遇到的脱发问题
- 织梦服务器有什么文件,对于织梦CMS各目录内文件的说明详解