ActiveMQ的一個bug

來源:互聯網
上載者:User

上午老闆給了我一個小任務:解決他筆記本不連網的時候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沒啟動起來,實際上是已經啟動了的。。。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.