-
1. Re: Best way to get thread dump from wildfly running as a Windows service (wildfly-servicexe/ apache procrun)
abhijithumbe May 17, 2017 8:15 PM (in response to milspec)You can use jstack tool which is shipped with JDK. You can use below command:
c:\Java\jdk1.7.0_51\bin\jstack.exe -l Pid >dump.txt
The user executing
jstack.exe
must be the same user who owns the JVM process or have sufficient privileges to access it (Administrator for example). -
2. Re: Best way to get thread dump from wildfly running as a Windows service (wildfly-servicexe/ apache procrun)
rcd May 18, 2017 4:57 PM (in response to milspec)I typically use JVisualVM, which is currently shipped as part of the JDK but apparently will be separate starting with JDK 9.
There are two fairly easy ways to connect JVisualVM to WF when WF is running as a service.
1) Configure the service to log on as some user account instead of as the Local System account. Then if you log on to the machine using the same account, the WF process will be visible.
2) WF exposes JMX over its HTTP port, unless you've changed your WF config to stop it from doing that. You can use this to access WF running as any user.
Start JVisualVM with the cli-client JAR on the classpath:
jvisualvm --cp:a $WFLY\bin\client\jboss-cli-client.jar
Then go to File -> Add JMX Connection. In the connection field, enter:
service:jmx:remote+http://localhost:$PORT
where $PORT is the port defined in the WildFly configuration file for the management-http socket-binding (9990 by default).