Sun GlassFish Enterprise Server v2.1.1 Troubleshooting Guide

Two Server Instances Bind to Same Port on Windows


This problem only occurs on Windows 2000/XP systems with the Enterprise Server software, and is due to a known Windows security flaw rather than a problem with the Enterprise Server itself.

The problem occurs when two or more instances of the Enterprise Server are created using the same port number for the instanceport option; for example:

asadmin create-domain -adminport 5001 <options\> -instanceport 6001
asadmin create-domain -adminport 5002 <options\> -instanceport 6001

When the two domains are started on a UNIX/Linux system, a port conflict error is thrown and the second instance fails to start. However, when the two domains are started on Windows 2000/XP, no error is thrown, both server instances start, but only the first instance is accessible at the specified port. When that first server instance is subsequently shut down, the second instance then becomes accessible. Moreover, when both instance are running, the Windows netstat command shows the duplicate listeners as active, but only the first listener can respond to requests.


Be sure to use unique port numbers for all server instances on Windows systems.