Skip to main content

glassfish error - process already using port 4848

5 replies [Last post]
wales321
Offline
Joined: 2012-11-12
Points: 0

I have searched for this problem and i have seen a number of topics. None of which really helped me or gave me a clear answer.
I am running glassfish on a mac and this is the first time i have used it.
I downloaded the .zip version and moved the unzipped folder into my documents folder. I have navigated to the glassfish3/bin and tried to execute the command
asadmin start-domain
This gives me the error below.
asadmin start-domain
There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
Command start-domain failed.

If i just enter asadmin i get the options to exit or get help, but when i try and start the domain i get the above error message. Could some help me with a clear answr on how to resolve this?
Thank you

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jdlee
Offline
Joined: 2006-01-25
Points: 0

Have you verified that the host name resolves to an IP? GlassFish fails to start if it can't resolve the host name. While the error message could probably be improved, that seems to be the most common cause. Either that or something else running on 4848. :)

wales321
Offline
Joined: 2012-11-12
Points: 0

Excuse my ignorance, but could you tell me how to do that please.

jdlee
Offline
Joined: 2006-01-25
Points: 0

If you are on a Linux box (or Mac?), your /etc/hosts should have a line like this:

127.0.0.1 localhost.localdomain localhost myHostName

On Windows, that file is something like c:\Windows\System32\drivers\etc\hosts

You can use the 'hostname' command to get you host name if you need to.

wales321
Offline
Joined: 2012-11-12
Points: 0

jdlee wrote:
If you are on a Linux box (or Mac?), your /etc/hosts should have a line like this:

127.0.0.1 localhost.localdomain localhost myHostName

On Windows, that file is something like c:\Windows\System32\drivers\etc\hosts

You can use the 'hostname' command to get you host name if you need to.

I have navigated to the file via terminal.
I have that line and it says
127.0.0.1 localhost
there is also another line that says broadcast host and two more that say localhost.

Where would i add this hostname command and would i just put hostname or my-imac for example

Also i have tried changing the port number from 4848 but the same error message keeps appearing, just with the different port number.

Lachezar Dobrev

Look at the file /etc/hostname. That is the name of your machine.

In /etc/hosts there should be a line that says
127.0.1.1

Where should be replaced with the contents of /etc/hostname

The 127.0.1.1 is just for an example. It may be any IP address
starting with 127, or can be the IP address of any of your machine's
hardware network interfaces (provided you have static addresses).
Using 127.0.0.1 works, but is discouraged! It *MUST* be an address,
that is attached to any local network interfaces (including the
virtual loop-back interface).

The line in /etc/hosts may be added by your DHCP client, but it's rare.

2012/11/13 :
>

jdlee wrote:
If you are on a Linux box (or Mac?), your /etc/hosts should
> have
>
> I have navigated to the file via terminal. I have that line and
> it says 127.0.0.1 localhost there is also another line that says broadcast
> host and two more that say localhost. Where would i add this hostname
> command
> and would i just put hostname or my-imac for example
>
> --
>
> [Message sent by forum member 'wales321']
>
> View Post: http://forums.java.net/node/892228
>
>