Skip to main content

Glassfish won't start because port 4848 is in use, however nothing is listening on port 4848 . . .

10 replies [Last post]
DylanBoates
Offline
Joined: 2012-11-08
Points: 0

I've run into the weirdest error.

Everything was working fine until I restarted the server yesterday but now, when I try to start Glassfish, it gives me this error:

/home/glassfish/bin/asadmin start-domain domain1
There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
Command start-domain failed.

I've seen it before when Glassfish failed to stop properly, so I checked for a running Glassfish process and didn't find anything. I also checked netstat -natp and lsof -i :4848 to see if anything is running that's using that port... Nothing.

Finally, I uninstalled Glassfish (I read elsewhere on the internet that this can happen when a domain gets corrupted), shut down Apache (just in case it was using the port but not telling me), restarted the whole server again, reinstalled Glassfish and I get the same error...

I'm totally stumped at this point. Has anyone else seen something like this before?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ljnelson
Offline
Joined: 2003-08-04
Points: 0

On Thu, Nov 8, 2012 at 10:42 AM, wrote:

> Has anyone else seen something like this before?
>

Yes, many times; no, I don't know what causes it either.

Best,
Laird

--
http://about.me/lairdnelson

DylanBoates
Offline
Joined: 2012-11-08
Points: 0

Have you been able to fix it before?

Knowing what caused it would be nice, but getting Glassfish working again is much more important to me at the moment.

daniel

Hi Laird,
1 Try to kill java to see if it works
2 Verify the PATH and "which asadmin" to see if there are any conflicts

Daniel

On 11/08/2012 11:36 AM, Laird Nelson wrote:
> On Thu, Nov 8, 2012 at 10:42 AM, > wrote:
>
> Has anyone else seen something like this before?
>
>
> Yes, many times; no, I don't know what causes it either.
>
> Best,
> Laird
>
> --
> http://about.me/lairdnelson
>

tmueller
Offline
Joined: 2005-10-31
Points: 0

Note that GlassFish interprets a failure to bind to port 4848 as meaning
that some other process is listening on it. It is possible that the
bind failed for some other reason.

Tom

jfdipol
Offline
Joined: 2007-08-16
Points: 0

One common cause of this is that the system can't resolve the system's
hostname. So you may want to make sure /etc/hosts looks good, and that
the system can resolve the system's hostname to an IP.

On 11/8/12 11:53 AM, Tom Mueller wrote:
> Note that GlassFish interprets a failure to bind to port 4848 as
> meaning that some other process is listening on it. It is possible
> that the bind failed for some other reason.
>
> Tom
>

DylanBoates
Offline
Joined: 2012-11-08
Points: 0

Thanks! This was it!

I had changed the hostname before that restart, so I guess Glassfish was still running with the old one that resolved fine.

I restored the old hostname and Glassfish started up fine. Now that I know what the issue is, hopefully I can figure out how to get the new hostname working.

Thanks a lot!

mvatkina
Offline
Joined: 2005-04-04
Points: 0

I had a problem when I re-logged in into my mac when GF was running. I
think I used 'ps -A |grep 4848' to find it (but may be there were mo
args to ps).

-marina

Joe Di Pol wrote:
>
> One common cause of this is that the system can't resolve the system's
> hostname. So you may want to make sure /etc/hosts looks good, and that
> the system can resolve the system's hostname to an IP.
>
>
> On 11/8/12 11:53 AM, Tom Mueller wrote:
>> Note that GlassFish interprets a failure to bind to port 4848 as
>> meaning that some other process is listening on it. It is possible
>> that the bind failed for some other reason.
>>
>> Tom
>>
>

ljnelson
Offline
Joined: 2003-08-04
Points: 0

On Thu, Nov 8, 2012 at 11:41 AM, daniel wrote:

> Hi Laird,
> 1 Try to kill java to see if it works
>

Java clearly works or asadmin wouldn't run and output what it does. Did
you mean something different?

> 2 Verify the PATH and "which asadmin" to see if there are any conflicts
>

I'm actually running it (always) with an absolute path. The issue the OP
is talking about is really just a minor annoyance; as he said, cleaning out
the various generated/cache directories and/or uninstalling and
reinstalling solves the problem. Clearly it doesn't ACTUALLY have to do
with a port conflict.

Best,
Laird

--
http://about.me/lairdnelson

DylanBoates
Offline
Joined: 2012-11-08
Points: 0

I don't think there's any conflict. There's a /usr/bin/asadmin on my PATH, but I'm always using the full path to run the asadmin that came with Glassfish.

There aren't any java processes running, so I can't kill java. (I've seen that before, where Glassfish kept running after I stopped it, but that's definitely not what's happening now.)

daniel

I met this problem before, I found there were two glassfish on my
machine, those two have conflict when i am doing the test. Originally,
my PATH is /usr/bin/asadmin. I changed the PATH to the "absolute path".
It works on my side.
You can try it.

On 11/08/2012 11:09 AM, forums@java.net wrote:
> I don't think there's any conflict. There's a /usr/bin/asadmin on my
> PATH,
> but I'm always using the full path to run the asadmin that came with
> Glassfish. There aren't any java processes running, so I can't kill java.
> (I've seen that before, where Glassfish kept running after I stopped
> it, but
> that's definitely not what's happening now.)
>
> --
>
> [Message sent by forum member 'DylanBoates']
>
> View Post: http://forums.java.net/node/892086
>
>