Unable to open socket file: target process not responding or HotSpot VM not loaded异常处理方法

版权声明:本文为原创文章,转载请标明出处。 https://blog.csdn.net/u013467442/article/details/88957485

1.问题

某台服务器出现假死的现象,服务进程在,但是就是不工作。于是想定位下,先看了下服务器本身的状态都是OK的,然后看下服务的状态,先执行如下的命令,发现服务是存在的,如下:
执行jps -ml输出如下:
在这里插入图片描述
然后执行jstack 2276,报出如下的错误:

2276: Unable to open socket file: target process not responding or HotSpot VM not loaded
The -F option can be used when the target process is not responding

在这里插入图片描述

2.解决

经过检查发现jstack后面的进程不是在root用户执行的,jstack需要使用与进程一致的用户才能执行。
执行ps -aux也能看出进程是由scehdule用户执行的。
在这里插入图片描述
于是执行sudo -u schedule `jstack 2276,能够正确执行,结果如下:
在这里插入图片描述

3.结论

jstack需要使用与进程一致的用户才能执行

猜你喜欢

转载自blog.csdn.net/u013467442/article/details/88957485
今日推荐