Java – Glassfish is running in background

application-serverglassfishjakarta-eejavatcp

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
    

Best Answer

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
Related Topic