18
votes

I recently downloaded Glassfish 4.0 and I want to use it in NetBeans for making some Web Applications, but when I want to start the domain1 (asadmin> start-domain domain1) I keep getting this error:"There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server". Any clue what could be the problem?

6
You have the answer in your question There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish serverKeerthivasan
It might be because the hostname isn't the correct oneJonathan Drapeau
This netstat -tulpn | grep 4848 will help verify the running processGilberto

6 Answers

35
votes

Glassfish could not resolve the host name. Diagnose the problem (on Linux) as follows:

  1. Open a Terminal.
  2. Type hostname.
  3. Type: ping $(hostname)

If the ping command fails (could not find the host), then add the host name to /etc/hosts. This can be accomplished as follows:

  1. Switch to root: sudo su -
  2. Type: echo "127.0.0.1 $(hostname)" >> /etc/hosts
  3. Kill GlassFish
  4. Restart GlassFish
6
votes

your system using port 4848 that is why. when glassfish starts its need three port numbers one for administrations, one for http applications other for https.

so in you system 4848 is already reserved by some program or server.

Or you can change default port number as per your need like below. type in command prompt.

To change the HTTP port to 10080:

  • asadmin set server.http-service.http-listener.http-listener-1.port=10080

To change the HTTPS port to 10443:

  • asadmin set server.http-service.http-listener.http-listener-2.port=10443

To change the administration server port to 14848:

  • asadmin set server.http-service.http-listener.admin-listener.port=14848
5
votes

Try lsof -i:4848 on the terminal.

Imgur

Kill the java processes listed using the command kill -9 <PID>.

If you have a GUI task manager, say like Activity Monitor on OSX, then you can just kill the java processes listed there.

Hope this works for anyone facing this problem.

3
votes

1- Go to the config folder inside your domain. (In my case: C:\Glassfish\glassfish\domains\mydomain\config\ )

2-Open the file domain

3-Update the port number on these three lines: enter image description here

4-Restart your domain:

--Note For restarting the domain:

1-Open cmd console

2-Navigate yo your domain

3-Execute: asadmin restart-domain mydomain

--I hope it helps :-)

2
votes

Solution can be this: in console type:

echo $HOSTNAME

then make sure the output follows 127.0.0.1 string in

/etc/hosts

For example:

127.0.0.1 dev.myserv.pl
1
votes

Do a

netstat -aon

from command line and check which process is using your port. If it's not important, kill it as a quick'n'dirty solution.