Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glassfish is running in background

Glassfish Server is running in background and I am not able to stop, start or restart the process. I know, restarting the system will do the job. Is there any other process to stop the process?

Here is the details:

  1. When I try to stop, it says it is domain1 is not running:

    C:\Server\glassfish4\glassfish\bin>asadmin stop-domain
    CLI306: Warning - The server located at C:\Server\glassfish4\glassfish\domains\domain1 is not running.
    Command stop-domain executed successfully.

  2. However I am able to open admin console in web browser for http://localhost:4848/common/index.jsf

  3. When I am trying to start or restart it throws error:

    C:\Server\glassfish4\glassfish\bin>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.

    C:\Server\glassfish4\glassfish\bin>asadmin restart-domain Server is not running, will attempt to start it... There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server. Command restart-domain failed.

  4. I tried to find PID with netstat -a -n -o command for the port 4848. I got two entries but not localhost id:

    TCP    0.0.0.0:4848           0.0.0.0:0              LISTENING       9116 
    TCP    [::]:4848              [::]:0                 LISTENING       9116
    
like image 647
Anirban B Avatar asked Jul 28 '15 09:07

Anirban B


2 Answers

Try this

taskkill /F /PID 9116

Also find the PIDs of processes which hold port 8080 and kill them. (If above solution don't work)

netstat -aon | find "LISTENING" | find ":8080"
taskkill /F /PID process_id_here
like image 69
Shrinivas Shukla Avatar answered Oct 17 '22 00:10

Shrinivas Shukla


If are you using Mac OS you should open terminal and will write following:

jps

(jps - is command that help you to see PID of this process of GlassFish) in my case I have following information:

MBP-Dmytro:~ melnychukdv$ jps
4004 ASMain
4500 Jps

After that we just kill this PID (in my case it is 4004):

sudo kill -4004 {PID}

or

sudo kill 4004 {PID}

That's all.

like image 29
Dmytro Melnychuk Avatar answered Oct 16 '22 23:10

Dmytro Melnychuk