镇江建设工程质量监督局网站简述基于构件的软件开发流程
news/
2025/9/30 23:34:01/
文章来源:
镇江建设工程质量监督局网站,简述基于构件的软件开发流程,有限责任公司的设立条件有哪些,太原中企动力网站建设前些天发现了一个巨牛的人工智能学习网站#xff0c;通俗易懂#xff0c;风趣幽默#xff0c;忍不住分享一下给大家。点击跳转到教程。
1. 情景描述#xff1a;只是想简单写个 ActiveMQ 的小样#xff0c;启动服务却报错#xff1a;
Error starting ApplicationContext…前些天发现了一个巨牛的人工智能学习网站通俗易懂风趣幽默忍不住分享一下给大家。点击跳转到教程。
1. 情景描述只是想简单写个 ActiveMQ 的小样启动服务却报错
Error starting ApplicationContext. To display the auto-configuration report re-run your application with debug enabled.
2018-08-01 16:10:39.858 ERROR 4928 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : ***************************
APPLICATION FAILED TO START
***************************Description:A component required a bean of type javax.jms.Queue that could not be found.Action:Consider defining a bean of type javax.jms.Queue in your configuration.2. 原因和解决
如提示信息中说的一样Queue 类没有纳入spring 的管理。加上注解 Bean 就行了。
错误写法
/*** author silence* date 2018/8/1 10:42*/
Component
public class MessageQueue{public Queue queue(){return new ActiveMQQueue(my-message);}}正确写法
package gentle.activemq;import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import javax.jms.Queue;/*** author silence* date 2018/8/1 10:42*/
Component
public class MessageQueue{Bean //返回一个名为 my-message 的队列,并且注册为 beanpublic Queue queue(){return new ActiveMQQueue(my-message);}}3. 成功启动服务
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/923358.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!