JMS Connection refused

J2EE 码拜 9年前 (2015-04-07) 1349次浏览 0个评论

各位前辈,小弟有个项目中使用到了JMS(使用的是ActiveMQ),但是一启动Tomcat就报如下错误,实在在百度不到答案了,请教各位前辈指点一下,分数不是很多,tomcat用的7.0.55  jdk 1.6 ,做了数据源设置

2014-10-30 15:38:55 org.springframework.jms.listener.DefaultMessageListenerContainer refreshConnectionUntilSuccessful
严重: Could not refresh JMS Connection for destination “”ActiveMQ.Adversory.Position”” – retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://127.0.0.1:61616. Reason: java.net.ConnectException: Connection refused: connect2014-10-30 15:38:56 org.springframework.jms.listener.DefaultMessageListenerContainer refreshConnectionUntilSuccessful
严重: Could not refresh JMS Connection for destination “”ActiveMQ.Adversory.AlarmCurrent”” – retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://127.0.0.1:61616. Reason: java.net.ConnectException: Connection refused: connect
2014-10-30 15:38:57 org.springframework.jms.listener.DefaultMessageListenerContainer refreshConnectionUntilSuccessful

严重: Could not refresh JMS Connection for destination “”ActiveMQ.Adversory.MachineInformation”” – retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://127.0.0.1:61616. Reason: java.net.ConnectException: Connection refused: connect
2014-10-30 15:38:58 org.springframework.jms.listener.DefaultMessageListenerContainer refreshConnectionUntilSuccessful

严重: Could not refresh JMS Connection for destination “”ActiveMQ.Adversory.Time”” – retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://127.0.0.1:61616. Reason: java.net.ConnectException: Connection refused: connect
2014-10-30 15:38:59 org.springframework.jms.listener.DefaultMessageListenerContainer refreshConnectionUntilSuccessful

严重: Could not refresh JMS Connection for destination “”ActiveMQ.Adversory.PartCount”” – retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://127.0.0.1:61616. Reason: java.net.ConnectException: Connection refused: connect
2014-10-30 15:39:00 org.springframework.jms.listener.DefaultMessageListenerContainer refreshConnectionUntilSuccessful

严重: Could not refresh JMS Connection for destination “”ActiveMQ.Adversory.MachineStatus”” – retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://127.0.0.1:61616. Reason: java.net.ConnectException: Connection refused: connect

属性文件配置:
###########ActiveMQ配置中心###########
##中间服务器URL
brokerURL=tcp://127.0.0.1:61616
##session缓存个数
sessionCacheSize=100

关于错误信息中的几个类配置:
<jms:listener-container destination-type=”topic”>
<jms:listener destination=”ActiveMQ.Adversory.MachineInformation”           ref=”machineInformationListener” />
<jms:listener destination=”ActiveMQ.Adversory.Time” ref=”timeListener” />
<jms:listener destination=”ActiveMQ.Adversory.PartCount” ref=”partCountListener” />
<jms:listener destination=”ActiveMQ.Adversory.MachineStatus” ref=”machineStatusListener” />
<jms:listener destination=”ActiveMQ.Adversory.Position” ref=”positionListener” />
<jms:listener destination=”ActiveMQ.Adversory.AlarmCurrent” ref=”alarmCurrentListener” />
<!– <jms:listener destination=”AlarmHistory” ref=”alarmHistoryListener” /> –>
</jms:listener-container>

JMS  Connection refused
20分
连接不上,你可以先检查下mq服务端运行是否正常
JMS  Connection refused
引用 1 楼 nyxiaobin123 的回复:

连接不上,你可以先检查下mq服务端运行是否正常

你的意思是需要另外下载ActiveMQ,然后启动?我之前运行该项目的时候没有用到mq服务啊,都是直接启动Tomcat,然后什么都不管就运行起来的;之前做项目的人走了,留下一堆烂摊子,小弟水平又有限…

JMS  Connection refused
20分
没有服务端怎么连接?

127.0.0.1:61616 这应该是服务端的地址 

查查这个端口是否有进程

JMS  Connection refused
我试过了,这个端口没有任何进程,是不是要启动MQ的服务?
JMS  Connection refused
引用 3 楼 benluobobo 的回复:

没有服务端怎么连接?

127.0.0.1:61616 这应该是服务端的地址 

查查这个端口是否有进程

我试过了,这个端口没有任何进程,是不是要启动MQ的服务? 

JMS  Connection refused
我记得之前运行此程序是不需要手动启动此服务的,但是现在需要手动启动MQ的服务,就不会报上面的错误了,谢谢各位!

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明JMS Connection refused
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!