由于地址已在使用错误,Activemq无法运行

use*_*462 16 activemq-classic

如何解决错误?

Java Runtime: Oracle Corporation 1.7.0_05 E:\Program Files\Java\jdk1.7.0_05\jre
  Heap sizes: current=1004928k  free=994439k  max=1004928k
    JVM args: -Dcom.sun.management.jmxremote -Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties -Dactivemq.classpath=F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\..\conf;F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\../conf;F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\../conf; -Dactivemq.home=F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\.. -Dactivemq.base=F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\.. -Dactivemq.conf=F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\..\conf -Dactivemq.data=F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\..\data -Djava.io.tmpdir=F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\..\data\tmp
ACTIVEMQ_HOME: F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\..
ACTIVEMQ_BASE: F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\..
ACTIVEMQ_CONF: F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\..\conf
ACTIVEMQ_DATA: F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\..\data
Loading message broker from: xbean:activemq.xml
 INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@2b9f7952: startup date [Sat Jul 28 18:10:38 CST 2012]; root of context hierarchy
 INFO | PListStore:[F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\..\data\localhost\tmp_storage ] started
 INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[F:\workspace\Eclipse java\destinytalk\DestinyServer\apache-activemq-5.6.0\bin\..\data\kahadb]
 INFO | KahaDB is version 4
 INFO | Recovering from the journal ...
 INFO | Recovery replayed 1 operations from the journal in 0.071 seconds.
 INFO | ActiveMQ 5.6.0 JMS Message Broker (localhost) is starting
 INFO | For help or more information please see: http://activemq.apache.org/
ERROR | Failed to start ActiveMQ JMS Message Broker (localhost, null). Reason: java.io.IOException: Transport Connector could not be registered in JMX: Failed to bind to server socket: tcp://0.0.0.0:61616 due to: java.net.BindException: Address already in use: JVM_Bind
java.io.IOException: Transport Connector could not be registered in JMX: Failed to bind to server socket: tcp://0.0.0.0:61616 due to: java.net.BindException: Address already in use: JVM_Bind
    at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27)
    at org.apache.activemq.broker.BrokerService.registerConnectorMBean(BrokerService.java:1836)
    at org.apache.activemq.broker.BrokerService.startTransportConnector(BrokerService.java:2327)
    at org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:2243)
    at org.apache.activemq.broker.BrokerService.start(BrokerService.java:551)
    at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1544)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485)
Run Code Online (Sandbox Code Playgroud)

Bin*_*n S 31

如果您使用的是Windows 7,请尝试禁用"Internet连接共享(ICS)"服务.

  • 尽管其他答案可以帮助您以通用的方式解决问题,但我发现这就是问题所在。ICS与AMQ在同一端口上运行,因此,如果您尝试与移动设备共享连接(例如与您的手机通话),然后再使用AMQ,则无明显原因会发现此错误。 (2认同)

Muk*_*kus 12

转到installation_folder/conf文件夹并打开activemq.xml文件.在文件上查找传输连接器.您可以从那里更改端口值.我从61616将其更改为6616.我无法通过运行netstat -ao命令查看Windows中正在使用它的进程.

<transportConnectors>
        <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
        <transportConnector name="openwire" uri="tcp://0.0.0.0:6616?maximumConnections=1000&amp;wireformat.maxFrameSize=104857600"/>
    </transportConnectors>
Run Code Online (Sandbox Code Playgroud)

  • 就我而言,使用该端口的是 Visual Studio。关闭它消除了错误。最好在所有服务器启动后再打开其他应用程序。 (2认同)

小智 6

我遇到了同样的问题,错误是:

错误| 无法启动ActiveMQ JMS Message Broker(localhost,null).原因:java.io.IOException:传输连接器无法在JMX中注册:无法绑定到服务器套接字:tcp://0.0.0.0:61616,原因是:java.net.BindException:地址已在使用中

以下步骤可能有用:

  1. 找到正在使用此端口的进程ID(在您的情况下,为61616).在命令promt中写:netstat -a -o -n并查看进程id.
  2. 接下来从任务管理器或taskkill/F/PID"进程ID"中删除该进程

http://sourcecode-kk.blogspot.in/2013/02/kill-process-running-on-certain-port-in.html

干杯.


Tim*_*ish 5

该错误告诉您已经有一个代理正在运行,或者正在运行的其他服务正在使用 ActiveMQ 想要将其 TCP 传输和 JMX 服务绑定到的所需端口。您可以在错误字符串“无法绑定到服务器套接字:tcp://0.0.0.0:61616 由于:java.net.BindException:地址已在使用中:”和“传输连接器无法在 JMX 中注册”中看到这一点: 无法绑定到服务器套接字: tcp://0.0.0.0:61616 由于: java.net.BindException: 地址已在使用:"

要解决此问题,您需要找出正在使用这些端口的正在运行的内容,或者更改配置以使用其他端口

  • 我在使用其他端口“61613”和“61614”时出错,我将它们更改为“6613”和“6614”,这对我来说效果很好 (2认同)