Activemq can't run due to - java.net.BindException: Address already in use: JVM_Bind

+1 vote
744 views
asked Jan 16, 2016 by Hitesh Garg (124 points)  

I am currently using activemq for a project and whenever I run it on my local system it logs the following error message.
I have tried to find the process running on this port but nothing shows up for this port.

Caused by: java.io.IOException: Failed to bind to server socket: tcp://0.0.0.0:61616?maximumConnections=1000&wireformat.maxFrameSize=104857600 due to: java.net.BindException: Address already in use: JVM_Bind
at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:138)
at org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:60)
at org.apache.activemq.transport.TransportFactory.bind(TransportFactory.java:124)
at org.apache.activemq.broker.TransportConnector.createTransportServer(TransportConnector.java:310)
at org.apache.activemq.broker.TransportConnector.getServer(TransportConnector.java:136)
at org.apache.activemq.broker.TransportConnector.asManagedConnector(TransportConnector.java:105)
at org.apache.activemq.broker.BrokerService.registerConnectorMBean(BrokerService.java:1972)
... 41 more

Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190)
at java.net.ServerSocket.bind(ServerSocket.java:376)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:231)
at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:134)
... 47 more

It sometimes work if I restart my system and run activemq as the first thing after restart.

1 Answer

0 votes
answered Jan 17, 2016 by Rahul Singh (128 points)  

I ran through the same issue and I found that I was sharing Internet Connection between LAN and Hotspot. So to solve this follow the steps below -

Solution 1 - Most possible solution

Go to Control Panel -- > View Network Connections --> Right click on your connected network and click on properties.
A new pop up window appears. in that window select sharing tab and disable network sharing.

This will release the port and you can start your activemq after that.

Solution 2

In case solution 1 does not work then-
Open Command Prompt and run netstat -a -o -n.

  • Find the process which is running against the port 61616.
  • Now kill the process from Task maager.
Welcome to Codingeek Q&A, where you can ask questions and receive answers from other members of the community.
...