ActiveMQ的一个bug

上午老板给了我一个小任务:解决他笔记本不连网的时候ActiveMQ无法启动的问题。我拔了网线后,启动ActiveMQ,报下面的错:

ERROR BrokerService                  - Failed to start ActiveMQ JMS Message
Broker. Reason: java.net.SocketException: error setting options
java.net.SocketException: error setting options
ERROR: java.lang.RuntimeException: Failed to execute start task. Reason:
org.springframework.beans.factory.BeanCreationE
xception: Error creating bean with name
'org.apache.activemq.xbean.XBeanBrokerService' defined in class path
resource [a
ctivemq.xml]: Initialization of bean failed; nested exception is
java.net.SocketException: error setting options
ERROR: java.lang.Exception:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.
apache.activemq.xbean.XBeanBrokerService' defined in class path resource
[activemq.xml]: Initialization of bean failed;
nested exception is java.net.SocketException: error setting options
网上搜索了下,发现是多播的问题,默认是允许多播的,可拔了网线后就只有一台机子了,所以多播就出问题了,我把activemq.xml里改了下:

<transportConnectors>
       <transportConnector name="openwire" uri="tcp://localhost:61616"/>
       <transportConnector name="ssl"     uri="ssl://localhost:61617"/>
       <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
      <transportConnector uri="http://localhost:8081"/>
       <transportConnector uri="udp://localhost:61618"/>
    </transportConnectors>
    <networkConnectors>
      <!-- by default just auto discover the other brokers -->
      <!--networkConnector name="default-nc" uri="multicast://default"/-->
      <!--networkConnector name="jjc" uri="static:(192.168.1.112)"/-->
      <!--networkConnector name="506-02" uri="static:(192.168.1.114)"/-->
      <networkConnector name="host1 and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)" failover="true"/>
    </networkConnectors>
拔掉网线,ok,ActiveMQ启动成功,哈哈,自以为搞定的时候,发现了一个古怪的问题,我把配置文件改回去,启动ActiveMQ,居然写的通信程序客户端之间还是可以进行通话,完全不受ActiveMQ前面报的错误的影响,真是让人哭笑不得。。。

估计是哪个开发人员开的玩笑,把这个warning写成了error吧,弄的我以为ActimveMQ没启动起来,实际上是已经启动了的。。。


本文转自Phinecos(洞庭散人)博客园博客,原文链接:http://www.cnblogs.com/phinecos/archive/2007/10/17/927695.html,如需转载请自行联系原作者
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值