5 Replies Latest reply on Aug 8, 2007 3:10 PM by Peter Johnson

    port already in use

    Linda Haddix Newbie

      I am having trouble with jboss-4.0.5GA not releasing the ports when I shut it down. Typically, I use ctl-c to shut down instead of the shutdown.bat, but it has happened even when I use the batch.

      The next time I try to start it, all of the ports come up saying they are already in use. Even if I shut down the computer, then restart I get the same thing. I can try to restart 3-4 times before it will finally start.

      Is there anyway to shut these down after the application window has closed?

      There are no other applications running, this machine is dedicated to jboss.

      I would appreciate any ideas on why this is happening.


        • 1. Re: port already in use
          Peter Johnson Master

          You are not using Windows Server 2003 by any chance? I ask because this seems be be a common issue on that OS (a search of the forums should reveal the other posts on this topic). And no I do not have a solution (other than the usual of one of 'try Linux instead'.)

          • 2. Re: port already in use
            Robert Wilcox Newbie

            I have the same problem on 4.0.4 GA on Windows XP. I don't see any of the ports in use when I run netstat. This appears to be localized to my computer as no one else seems to be having a problem. I tried renaming ports, but each time I did the next port reports a problem. After renaming the fourth port I gave up. There must be something else causing this problem. Any ideas would be appreciated...

            • 3. Re: port already in use
              Peter Johnson Master

              I have noticed on my Windows XP boxes (desktop at work and laptop at home) that at some point both netstat and tcpview were malfunctioning. That is, they did not report all of the ports that were open. This phenomenon lasted for 1 or 2 months. Happily, since about a month ago, it is working correctly again in both locations.

              I would blame my firewall/internet-security-suite, but I am using two different products on the two different machines. So I blame MS patches instead. You might want to go to Windows Update and get the latest patches.

              • 4. Re: port already in use
                Robert Wilcox Newbie

                I was able to resolve this issue. What finally worked was to keep changing port numbers until the app is running. (Mind you that netstat showed all of the ports were available). After this, I shutdown the app and rebooted the machine. After rebooting, I reverted the app to the original port numbers. Guess what? Everything works now. It seems as if JBoss kept a list of ports in use that did not reflect reality as I could never verify that these ports were in use.

                I used another freeware program called freeportscanner to check if the ports were in use and it also showed that the ports were available. I really doubt that all 5 or 6 ports could've been in use by other programs and that netstat would not show it. This problem persisted even after reboots.......

                • 5. Re: port already in use
                  Peter Johnson Master

                  Neither JBoss nor the JVM (at least, not the Sun JVM; you never said which JVM you are using) keep track of ports opened previously. They blindly request a port from the OS and only report a problem if the OS does not allow them to connect to the port. So the fault is with Windows, but most likely with the network card or its driver.