Skip to main content

startup error - no free port within range

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
desert_impact
Offline
Joined: 2012-06-15

Hi,
I am trying to start up a 2nd instance of glassfish server on my system. The first one uses the defaults, admin port=4848, http port=8080. Now I'm trying to start another instance with admin port=4849, http port=8081, but I get a "No free port within range" error as seen below:

===========================================================================================
waiting for domain1 to start ....Command start-domain failed.
Error starting domain domain1.
The server exited prematurely with exit code 0.
Before it died, it produced the following output:

Launching GlassFish on Felix platform
[#|2012-06-15T11:47:45.973-0600|INFO|glassfish3.1.2|com.sun.enterprise.server.logging.GFFileHandler|_ThreadID=1;_ThreadName=main;|Running GlassFish Version: GlassFish Server Open Source Edition 3.1.2 (build 23)|#]

[#|2012-06-15T11:47:46.259-0600|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=20;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.46 started in: 42ms - bound to [0.0.0.0:8081]|#]

[#|2012-06-15T11:47:46.261-0600|SEVERE|glassfish3.1.2|grizzly|_ThreadID=23;_ThreadName=Grizzly-kernel-thread(1);|doSelect IOException
java.net.BindException: No free port within range: 8181=com.sun.enterprise.v3.services.impl.monitor.MonitorableSSLSelectorHandler@64d4c0d
at com.sun.grizzly.TCPSelectorHandler.initSelector(TCPSelectorHandler.java:432)
at com.sun.grizzly.TCPSelectorHandler.preSelect(TCPSelectorHandler.java:378)
at com.sun.grizzly.SelectorHandlerRunner.doSelect(SelectorHandlerRunner.java:188)
at com.sun.grizzly.SelectorHandlerRunner.run(SelectorHandlerRunner.java:132)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
============================================================================================

Can I not have 2 instances of glassfish server running? It would seem ok since I use different admin and http ports for each. I must be missing something or doing something boneheaded...

TIA for any advice.