On a linux machine, am trying to start Glassfish server.


This returns the following message:

There is a process already running using the admin port 4848 -- it is probably another instance of a Glassfish server

Have tried to identify which process this is with the following command:

lsof -t -i tcp:4848

On another machine on which Glassfish is running, this command returns the process id used by Glassfish. However, on the machine on which we are having the issue, nothing is returned.

What is the best way to identify and kill the process using port 4848, given that the lsof -t -i tcp:4848 is not helping?


  • 3
    Try the same command as root. Any progress? May 26, 2021 at 8:02
  • 1
    netstat -tlp | grep 4848 or ss -tlp | grep 4848 ?
    – Archemar
    May 26, 2021 at 8:07
  • Neither return anything. ss -tlp | grep 4848 works on the server on which Glassfish is running, but not netstat -tlp | grep 4848 May 26, 2021 at 8:11
  • 2
    did you try it as root user? That makes a difference.
    – A.B
    May 26, 2021 at 8:15
  • 1
    @Archemar This assumes glassfish is the culprit. Without such assumption pgrep cannot be used "to identify and kill the process using port 4848". I'm not saying your idea is useless. I'm posting this comment because I think assumptions like this should be stated explicitly to avoid other assumptions (especially from the OP) which may turn out to be incorrect. May 26, 2021 at 9:07

1 Answer 1


There are probably two things going on here. One is that there is something listening on the port and lsof and friends are missing it or the startup script/error message is confused.

Network namespaces may hide the port, but if you want to directly query the proc filesystem try

grep 12f0 /proc/net/tcp
grep 12f0 /proc/net/tcp6

12f0 is 4848 in hex and those files are where the kernel stores the information about TCPv4 and TCPv6 sockets.

If you get matching lines then there really is a something listening to the port and your tools are sus. No hit means either you have namespaces in play or the startup script is playing up.

You can also check if the socket is really in use with netcat

nc -l 4848

If its silent then its ok, if it complains about socket in use, then it really is in use and you need to check your tools are ok and namespaces.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .