Activemq can't run due to address already in u

2020-06-08 03:08发布

How to solve the error?

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)

标签: activemq
14条回答
\"骚年 ilove
2楼-- · 2020-06-08 03:21

I have the same issue and it seems the port is blocked by another JVM using AMQ connection (ServiceMix as a client of the AMQ service).

Restarting the ServiceMix unlock the port reservation and the ActiveMQ Service restart without issues.

Note that the old ActiveMQ process was no running anymore and this seems a limitation of two JVM and Windows blocking the port as a client still uses it. This is not because two instance are trying to start at the same time.

This perhaps does not answer your specific problem, but it can also helps other people having the same setup.

查看更多
SAY GOODBYE
3楼-- · 2020-06-08 03:23

The above post are valid that changing openwire port to 6616 work but it might happen to you as happened to me that amqp port was also occupied so u need to change that also(from 5672 to 5762(or any other)) config according to me is:-

  <transportConnector name="openwire" uri="tcp://0.0.0.0:6616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="amqp" uri="amqp://0.0.0.0:5762?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
查看更多
可以哭但决不认输i
4楼-- · 2020-06-08 03:25

find the process id using the port number from error logs.

fuser [port number]/tcp

then use kill -9 [pid] to kill that process.

查看更多
男人必须洒脱
5楼-- · 2020-06-08 03:26

Sometimes this error is caused when you have Mosquitto installed alongside ActiveMQ. this is a port number conflict caused by Mosquitto MQTT service running on port 1883 whiles Activemq server MQTT feature tries to run on that port. What you have to do is to either edit the mqtt conntector port in the conf/activemq.xml or commenting that line out like this

<!-- <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/> --> 

Then start the service again

查看更多
够拽才男人
6楼-- · 2020-06-08 03:27

ERROR | Failed to start Artemis JMS Message Broker. Reason: Address already in use

In my case i had to make kill the process that was using 8161 in bootstrap.xml (in etc folder)

Following below steps to find PID and kill the process

  1. find the process id that is using this port (in your case, 8161). In command prompt write: netstat -a -o -n and look at the process id.
  2. Next kill the process by typing: taskkill /F /PID "process id" by running the command prompt in administrator mode
查看更多
来,给爷笑一个
7楼-- · 2020-06-08 03:30

I run into this issue when deploying an embedded active MQ broker as part of a application based on Apache Camel on a Windows Server 2012R2 host. I followed the advice of posted above and changed the port to which the broker was bound (from 61616 to 6616)

查看更多
登录 后发表回答