Rajdeep Sardar
Rajdeep Sardar

Reputation: 113

ThreadDump Collection from Tomcat

I am trying to get a threaddump of the JVM. I used top command and ps aux to find the process id and the user of the pid [which is root].

So I run following command to get the threaddump

sudo -u root jstack -F PID > threaddump1.txt

But I am getting following exception---------------------------------

Error attaching to process: Doesn't appear to be a HotSpot VM (could not find symbol "gHotSpotVMTypes" in remote process)

sun.jvm.hotspot.debugger.DebuggerException: Doesn't appear to be a HotSpot VM (could not find symbol "gHotSpotVMTypes" in remote process)**
    at sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:411)
    at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:305)
    at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:140)
    at sun.jvm.hotspot.tools.Tool.start(Tool.java:185)
    at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
    at sun.jvm.hotspot.tools.JStack.main(JStack.java:92)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at sun.tools.jstack.JStack.runJStackTool(JStack.java:140)
    at sun.tools.jstack.JStack.main(JStack.java:106)

Any help or suggestion or input is deeply appreciated.

Upvotes: 1

Views: 2443

Answers (1)

Rajdeep Sardar
Rajdeep Sardar

Reputation: 113

Ok. I finally could figure out the problem. The tomcat was running under docker. So I have to run the commands within docker. I followed below mentioned steps.

1. Access the docker
2. Find the PID of tomcat by running command within docker.
3. Run command /<oracle path>/bin/jstack PID >> filename

Upvotes: 2

Related Questions