6 Replies Latest reply on Sep 21, 2002 10:10 PM by Erik

    jboss 2.4.4 : java.net.BindException: Address in use: JVM_Bi

    Jim Barritt Newbie

      Hi,

      Sorry if theres already a solution to this posted - i couldnt find it.

      I get this error when starting jboss 2.4.4 with tomcat 4.0.1 for the second time in a session.

      [NamingService] INFO : Starting jnp server
      [NamingService] ERROR: Could not start on port 1099
      java.net.BindException: Address in use: JVM_Bind
      at java.net.PlainSocketImpl.socketBind(Native Method)
      at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:405)
      at java.net.ServerSocket.(ServerSocket.java:170)
      at org.jnp.server.Main.start(Main.java:200)
      at org.jboss.naming.NamingService.startService(NamingService.java:148)
      at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
      at $Proxy0.start(Unknown Source)
      at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.Main.(Main.java:208)
      at org.jboss.Main$1.run(Main.java:110)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.jboss.Main.main(Main.java:106)
      [NamingService] INFO : InitialContext Environment:
      [NamingService] INFO : key=java.naming.factory.initial, value=org.jnp.interfaces.NamingContextFactory
      [NamingService] INFO : key=java.naming.factory.url.pkgs, value=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces
      [NamingService] INFO : Naming started on port 1099
      [NamingService] INFO : Started


      Although it says the service is started, i cant then deploy anything or connect to the server. I am running win2k professional. jdk1.3. a collegue has tried it with jdk 1.4 and believes that this sorts it out.

      I have to re-boot my machine to make it work again.

      Does anyone have any clues as to what is happening ?

      cheers

      Jim

        • 1. Re: jboss 2.4.4 : java.net.BindException: Address in use: JV
          Adrian Brock Master

          JBoss is not shutting down properly.
          This is why the naming service cannot allocate the port a second time.

          It is a bit rubbish that the jnp server traps the error, prints it but then doesn't forward it the caller, i.e. the NamingService.
          But that's just cosmetic.

          You don't need to reboot. Use taskmanager to end task on a process named JAVA.EXE. Make sure you get
          the right one!
          I've done this a lot when investigating a similar problem in 3.0. It doesn't lead to system instability.

          Do you know why JBoss is not shutting down?
          What happens first time you run?

          The problem I am seeing is pretty complicated.
          I'll spare you the details. But it also happens
          on jdk 1.4.

          More commonly you can get hangs because there is a
          problem with the data source configuration.
          Basically, start() waits for something that isn't there, but stop() doesn't work because it is synchronized with start() - deadlock :-(

          Regards,
          Adrian

          • 2. Re: jboss 2.4.4 : java.net.BindException: Address in use: JV
            Jim Barritt Newbie

            Hi Adrian,

            Thanks for the reply. Ive just tried it again, with no JDBC connections active and no applications deployed. I just start the server once, use the JMX shutdown command to stop it and it all looks ok - no exceptions, etc, then i try to start it again and i get the same error.

            Someone mentioned that it maybe a problem with the socket implementation under win 2K ? Anyway, i shall persevere - its getting annoying being stuck on the beta release!!

            cheers

            Jim

            • 3. Re: jboss 2.4.4 : java.net.BindException: Address in use: JV
              Jim Barritt Newbie

              Further investigation reveals that it is actually tomcat that seems to fail (with 2.4.4 release and tomcat 3.2.3) aswell.

              By changing the port numbers in the jboss.jcml, and restarting, i can get it to work without restarting my machine, but it definitely seems to be hanging on to the port when it shuts down, even during a clean shut down.


              • 4. Re: jboss 2.4.4 : java.net.BindException: Address in use: JV
                David Jencks Master

                Just a couple of other weird examples...

                Normal shutdown usually works for me (jboss cvs, linux 2.4.16 kernel, sun jdk 1.3.1 I think) however I have sometimes gotten jboss to hang during shutdown. If I do kill 9 the ports are not released and I can't figure out what to do except reboot, however kill -s SIGABRT releases the ports.

                On mac osX, on the other hand, c-c appears to kill jboss without running the shutdown hook, but all ports are released and I can start it right up again.

                Don't know what this just goes to show...

                • 5. Re: jboss 2.4.4 : java.net.BindException: Address in use: JV
                  Jim Barritt Newbie

                  Ive discovered that shutting down the DHCP client on my win 2k machine, then starting jBoss and then restarting DHCP client service seems to do the trick. This is probably a bit brute force, but works.

                  I am in the process of trying to get a static IP addres for my machine so i can try not having the DHCP client working.

                  I discovered this after rebooting this morning to find that i got the jvm bind even after a fresh restart. Further to my previous post about tomcat - it seemed to be a temporary one, and it is back now to happening on the main JNP service. hey ho.

                  • 6. Re: jboss 2.4.4 : java.net.BindException: Address in use: JV
                    Erik Newbie

                    I just got the problem, but I never had problems for nearly a year on this same machine, hosting OpenStandards.net with JBoss 2.4.0/Tomcat 3.2.3. One day I was updating data through the site, and it just bombed. I later noticed this error message during startup. Unfortunately, a reboot doesn't help.

                    I suspect Nimda, as I found evidence of it resurfacing on the machine. Nothing has been changed on the machine, and the changes I was making were just routine data updates through a browser on another computer. So, the configuration explanations described in this thread so far do not match my situation.

                    Anyone else having problems like this, that suddenly pop up, and then never clear up? Run a Nimda detection and removal tool and see if you have the virus. Please report any findings to this thread.