Skip to main content

Odd permission issue starting GF on Mac OS X

4 replies [Last post]
emailnbw
Offline
Joined: 2008-05-28
Points: 0

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

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tmueller
Offline
Joined: 2005-10-31
Points: 0

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
>
>

emailnbw
Offline
Joined: 2008-05-28
Points: 0

Tom, thanks for the info. In this case the underlying cause seems to be a permissions issue vs. a name resolution one since it bound fine when I used 'sudo' to run asadmin.

-Noah

On Sep 18, 2012, at 11:33 AM, Tom Mueller wrote:

> 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
>>
>>
>

Lachezar Dobrev

You may get a permission denied, because you tried to bind to a
different host name, not because the port is already bound. Maybe you
can check if there are any remnants of the old name in domain.xml?
It may also be due to lingering name resolution issues...
For instance... You may have the old name standing against 127.0.0.1
in /etc/hosts...

2012/9/18 Noah White :
> Tom, thanks for the info. In this case the underlying cause seems to be a
> permissions issue vs. a name resolution one since it bound fine when I used
> 'sudo' to run asadmin.
>
> -Noah
>
> On Sep 18, 2012, at 11:33 AM, Tom Mueller wrote:
>
> 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
>
>
>
>

papp.zoltan@mondoka.hu

Did you try access the web-admin 4848 from remote?

2012.09.18. 3:25 keltezéssel, Noah White írta:
>
> 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
>
>
>
> --
> Ezen uzenet virusellenorzesen esett at, es virusmentesnek bizonyult.
> *MailScanner* - Email Virus Scanner
> A MailScanner koszoni a transtec Computers
> tamogatasat.