users@glassfish.java.net

Re: Odd permission issue starting GF on Mac OS X

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Tue, 18 Sep 2012 10:33:01 -0500

It is the case that GlassFish tries to bind to port 4848 as a listener,
and if it fails, it reports this message even if the real reason it
could not bind was not because there is another server listening on the
port. There are other situations that can cause GlassFish to be unable
to bind to that port, including certain name resolution issues.

Tom

On 9/17/2012 8:25 PM, Noah White wrote:
>
> I'm running Mac OS X 10.8.1 (Mountain Lion) and I usually start
> Glassfish (3.1.2.2) as a non-root user with asadmin. That was working
> great until the other day. Then all of a sudden I started getting the
> following error:
>
> *"There is a process already using the admin port 4848 -- it probably
> is another instance of a GlassFish server.*
> *Command start-domain failed."*
> *
> *
> The thing is there isn't anything running on 4848.
>
> Finally, I tried running asadmin with sudo like so:
>
> sudo ./asadmin start-domain domain1
>
> Et voila that worked. Except for the fact that this has never
> required root privs before! So that got me thinking and the only
> other change I'd made recently was I set my host name which up until
> that point was the default one set when I installed Mountain Lion. The
> procedure I used to set my host name was to run scutil like so:
>
> sudo scutil --set HostName MyNewHostName
>
> So I decided to try to roll that change back and I ran:
>
> sudo scutil --set HostName
>
> That cleared the host name and the hostname command now returns the
> default one. Once I did that I was able to start GF w/asadmin without
> need the sudo.
>
> Any thoughts on this one? It seems to me that at the very least the
> error GF is reporting in this case is misleading. Perhaps the
> underlying cause is a general connection refused exception when it
> tries to bind to the port vs. a permissions exception and that why it
> reports the error as it does, but if the underlying cause is a
> permissions one then I think GF should report a more accurate message
> in response.
>
> -Noah
>
>