users@glassfish.java.net

Ports used by glassfish v2.1?

From: Ed Hillmann <ed.hillmann_at_gmail.com>
Date: Fri, 23 Oct 2009 15:30:10 +1000

Hi all. We're using Glassfish v2.1, and when we set up our domains, we
provide it with 7 ports, as that is what is documented. We have a bunch of
developers that run their own Glassfish domains, so we make sure we reserve
them ports for their use (servers are running on Linux).

We've noticed, however, that sometime our reserved ports are being used by
other people inadvertantly. So, I did a test where I checked the ports
being used by running "netstat -ae | grep <me>" before starting my server.
Then starting my glassfish server. Then checking the ports again. The net
different looks like:

tcp 0 0 *:10020 *:*
LISTEN ehillman 7561815
tcp 0 0 *:10021 *:*
LISTEN ehillman 7561837
tcp 0 0 *:57893 *:*
LISTEN ehillman 7561778
tcp 0 0 *:10022 *:*
LISTEN ehillman 7561767
tcp 0 0 *:10023 *:*
LISTEN ehillman 7561834
tcp 0 0 *:10024 *:*
LISTEN ehillman 7561790
tcp 0 0 *:10025 *:*
LISTEN ehillman 7561770
tcp 0 0 *:10026 *:*
LISTEN ehillman 7561771
tcp 0 0 *:10027 *:*
LISTEN ehillman 7561776
tcp 0 0 *:53100 *:*
LISTEN ehillman 7561805
tcp 0 0 *:10577 *:*
LISTEN ehillman 7561802
tcp 0 0 *:30161 *:*
LISTEN ehillman 7561797
tcp 0 0 *:51576 *:*
LISTEN ehillman 7561795
tcp 0 0 localhost6.localdomain:6011 *:*
LISTEN ehillman 7557390
tcp 0 0 *:46108 *:*
LISTEN ehillman 7561801
tcp 0 0 localhost.localdomain:30080 localhost.localdomain:26714
ESTABLISHED ehillman 7561764
tcp 0 0 dingbat:19468 dingbat:57893
ESTABLISHED ehillman 7561782
tcp 0 0 dingbat:30161 dingbat:12042
ESTABLISHED ehillman 7561798
tcp 0 0 dingbat:38385 dingbat:10027
ESTABLISHED ehillman 7561787
tcp 0 0 dingbat:38383 dingbat:10027
ESTABLISHED ehillman 7561780
tcp 0 0 dingbat:10027 dingbat:38383
ESTABLISHED ehillman 7561777
tcp 0 0 dingbat:10027 dingbat:38385
ESTABLISHED ehillman 7561781
tcp 0 0 localhost.localdomain:26714 localhost.localdomain:30080
ESTABLISHED ehillman 7561808
tcp 0 0 dingbat:57893 dingbat:19468
ESTABLISHED ehillman 7561779
tcp 0 0 dingbat:12042 dingbat:30161
ESTABLISHED ehillman 7561799

For me on this machine, my domain explicitly uses ports 10020 to 10027,
which I can see in the report. However, there are other ports that
Glassfish uses (I guess it finds the first one available). In this report,
there's port 57893, 53100, 10577, 30161, 51576, 46108

That's six ports that are being used up. I'm finding that, every so often,
it uses a port that has been reserved for someone else (they didn't have
their server running). Then that person can't start up, or something breaks
because the port can't be used.

I need to be able to state "The glassfish server is using these ports and
only these ports". From what I'm seeing, I can't. Can I have more control
over what ports are used? I thought I could, but I don't have a warm and
fuzzy feeling about this.

Thanks for any info,
Ed