Thursday, April 27, 2017

JBoss port conflict issue

Problem:

18:05:55,888 INFO  [JMXKernel] Legacy JMX core initialized
18:06:01,661 INFO  [WebService] Using RMI server codebase: http://192.168.0.105:8083/
18:06:01,974 ERROR [Naming] Could not start on port 1099
java.net.BindException: Address already in use
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
        at java.net.ServerSocket.bind(ServerSocket.java:328)
        at java.net.ServerSocket.<init>(ServerSocket.java:194)
        at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:170)
        at org.jnp.server.Main.initBootstrapListener(Main.java:480)
        at org.jnp.server.Main.start(Main.java:427)

Solution:

I got this when I was trying to start my jboss server and in my case it was because Endeca ToolsAndFrameworks seem to have started already and was using the same port, so I just shutdown Endeca, started JBoss and it started ok, then restarted Endeca and Endeca was intelligent enough to pick a different port to avoid conflict. You can always use netstat to find which process is using the port and try and shut it down or start it after jboss. You can also start jboss with a different port - ports-01, ports-02, ports-03 etc., using the following command


run -Djboss.service.binding.set=ports-01