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?
-
2You have the answer in your question *There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server* – Keerthivasan May 23 '14 at 11:19
-
3It might be because the [hostname isn't the correct one](http://stackoverflow.com/questions/7391466/unable-to-start-glassfish-3-1-even-though-port-not-occupied) – Jonathan Drapeau Nov 24 '14 at 14:32
-
This `netstat -tulpn | grep 4848` will help verify the running process – Gilberto Sep 29 '15 at 23:57
6 Answers
Glassfish could not resolve the host name. Diagnose the problem (on Linux) as follows:
- Open a Terminal.
- Type
hostname
. - 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:
- Switch to root:
sudo su -
- Type:
echo "127.0.0.1 $(hostname)" >> /etc/hosts
- Kill GlassFish
- Restart GlassFish

- 30,436
- 41
- 178
- 315

- 664
- 6
- 6
-
2You are right. I knew it was nothing to do with some other process on port 4848 (nc -l 4848 worked). I added the output of `hostname` on `/etc/hosts` and it worked. BTW, I was happening both with Glassfish 4.0 and 4.1. – Diogo Melo Apr 27 '16 at 18:52
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

- 2,091
- 1
- 17
- 32
-
How can I change the port of Glassfish, or how can I find out what is occupying this port and stop that process? – Srdan Ristic May 23 '14 at 11:22
-
-
I found name="admin-listener" port="4848"... what port should I use instead of 4848 which is a guess default port? – Srdan Ristic May 23 '14 at 11:27
-
you may use whatever you like but as your problem it should not be use by your system like 4848 – Sanjay Rabari May 23 '14 at 11:29
-
I tried to change the administration server port to 14848 as you mentioned above but I got this: "Remote server does not listen for requests on [localhost:4848]. Is the server up?". – Srdan Ristic May 23 '14 at 11:33
-
The answer from @togomez below is more accurate; at least in my case, and I'm betting for most people. – Bane Dec 03 '19 at 16:36
Try lsof -i:4848
on the terminal.
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.

- 2,438
- 2
- 23
- 28
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:
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 :-)

- 3,179
- 32
- 31
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,689
- 1
- 17
- 20
-
Worked for me because fqdn of my new cloned glassfish server was still pointing to its Old IP. – Bikramjit Singh May 14 '18 at 14:41
-
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.

- 5,531
- 5
- 39
- 70