2 Replies Latest reply on Mar 21, 2017 4:53 AM by andey

    Error initializing endpoint: java.net.BindException: Address already in use

    transferim

      Hi there,

       

      I'm exploring how to migrate a product from Jboss 5 to Jboss
      7 (and ultimately on to the latest vision of Wildfly)

       

      After my migration I'm getting ERROR [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Error initializing endpoint: java.net.BindException: Address already in use.

       

      I've tried changing the port to something custom like 8181 and there's still a clash somewhere. Checking Process Explorer I only have one Java process running. It's as if something is being called twice.

       

      I'd like to understand what might be happening. Please let me know if you require any further info. Thanks in advance.

       

       

      15:55:01,796 INFO  [org.jboss.as.naming] (MSC service thread 1-3) JBAS011802: Starting Naming Service
      15:55:01,867 INFO  [org.xnio.nio] (MSC service thread 1-4) XNIO NIO Implementation Version 3.0.3.GA
      15:55:01,890 INFO  [org.jboss.remoting] (MSC service thread 1-4) JBoss Remoting version 3.2.3.GA
      15:55:01,902 INFO  [org.jboss.as.connector] (MSC service thread 1-3) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
      15:55:01,925 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
      15:55:01,931 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
      15:55:01,934 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
      15:55:02,158 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
      15:55:02,264 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http--127.0.0.1-8181
      15:55:02,226 ERROR [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Error initializing endpoint: java.net.BindException: Address already in use: JVM_Bind /127.0.0.1:8181
      at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:983) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:190) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.connector.Connector.init(Connector.java:983) [jbossweb-7.0.13.Final.jar:]
      at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:267) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]

      15:55:02,683 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.web.connector.connector2: org.jboss.msc.service.StartException in service jboss.web.connector.connector2: JBAS018007: Error starting web connector
      at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:271)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
      Caused by: LifecycleException:  Protocol handler initialization failed: java.net.BindException: Address already in use: JVM_Bind /127.0.0.1:8181
      at org.apache.catalina.connector.Connector.init(Connector.java:985)
      at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:267)
      ... 5 more antalya transfer

        • 1. Re: Error initializing endpoint: java.net.BindException: Address already in use
          mortytenenbaum

          Ahmet:

          Port 8181 could be used by something other than this or another Java process.

           

          Take a look at all active ports on your system before you start JBoss with

          netstat -an

          (this is the Windows form, Linux has similar )

          If you see that 8181 is active then you can also run

          netstat -anb

          The "b" identifies the process which is starting this.

           

          If 8181 is not active before you start JBoss then perhaps one of the other subsystems is latching on to this.  A look at your standalone.xml config file And setting more DebuggyIsh Logging settings should reveal more.

           

          Happy Hunting!

          • 2. Re: Error initializing endpoint: java.net.BindException: Address already in use
            andey

            Hi,

             

            There are various root cause:

             

            • Port already in use by another process (another JBoss EAP instance or another service running on the platform)
            • Verify whether If same JBoss process/database server process/ etc... had been already listened same port
            • Check whether another instance of JBoss is already running. And Check whether there is a port conflict between the JBoss instances by running the grep for the port in each of the AS instances.
            • Check whether any firewall or security software could prevent JBoss from opening the port
            • If there are duplicate ports, in the JBoss AS instances, make the necessary updates so that the port setting in each configuration is unique.
            • You can check all your java process in your operating system and kill them all the be sure that nothing else is running in the 8181 port.

             

             

            It suggests that the port 8181 is already in use. You may either: Try searching for that process and stop it OR Make your JBoss to run on different (free) port.  Searching for that process and stop it procedure:

             

            If you running on windows you can use, netstat -aon executed in the command prompt. For linux, netstat -tulpn | grep 8181. Once this is executed you will get a list of processes running on the 8181 port as you get java.net.BindException: Address already in use: JVM_Bind <null>:8181 exception.

             

            Now execute this command in the linux terminal : kill -9 {process pid}. In windows, taskkill /f /pid {pid} PID stands for the process ID. Now that process is killed. Try running JBoss again. It will work now.