Glassfish 在后台 运行

Glassfish is running in background

Glassfish Server 运行 在后台,我无法停止、启动或重新启动该进程。我知道,重启系统就可以了。是否有其他进程停止进程?

详情如下:

  1. 当我试图停止时,它说是 domain1 不是 运行:

    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. 但是我可以在 Web 浏览器中为 http://localhost:4848/common/index.jsf

  3. 打开管理控制台
  4. 当我尝试启动或重新启动时它抛出错误:

    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.

  5. 我尝试使用 netstat -a -n -o 命令为端口 4848 查找 PID。我有两个条目但没有本地主机 ID:

    TCP    0.0.0.0:4848           0.0.0.0:0              LISTENING       9116 
    TCP    [::]:4848              [::]:0                 LISTENING       9116
    

试试这个

taskkill /F /PID 9116

同时找到持有 port 8080 的进程的 PID 并杀死它们。 (如果上述解决方案不起作用)

netstat -aon | find "LISTENING" | find ":8080"
taskkill /F /PID process_id_here

如果您使用的是 Mac OS 您应该打开终端并写入以下内容:

jps

(jps - 是帮助您查看此 GlassFish 进程的 PID 的命令) 就我而言,我有以下信息:

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

之后我们就杀掉这个 PID(在我的例子中是 4004):

sudo kill -4004 {PID}

sudo kill 4004 {PID}

就这些了。