[ACCEPTED]-How to Force Thread Dump in Eclipse?-weblogic

Accepted answer
Score: 25

Indeed (thanks VonC to point to the SO thread), Dustin, in 9 a comment to his message, points to jstack.

I have 8 run a little Java application (with GUI) in 7 Eclipse, I can see the related javaw.exe 6 in Windows' process manager and its PID, 7088 5 (it is even simpler in Unix, of course).

If 4 I type at a command prompt jstack 7088, I have the 3 wanted stack dump per thread.
Cool.

Would 2 be better if we could do that directly from 1 Eclipse, but that's already useful as is.

Score: 7

You can do it when you are in debug mode: go 9 to the debug view in the debug perspective, click 8 on the process you have launched and click 7 on pause, you will get a graphical stack 6 of all your processes.

Note : this also works 5 when using remote debugging, you do not 4 need to launch weblogic from eclipse, you 3 can launch it on its own, open the debugging 2 ports and create a "remote java application 1 debug configuration" for it.

Score: 3

Eclipse Wiki: How to Report a Deadlock lists all possible options 4 of creating a thread dump in Eclipse. Depending 3 on the concrete situation, one or the other 2 may work better -- my personal favorite 1 on Windows is the Adaptj Stacktrace tool.

Score: 2

StackTrace is another option that you could try. From 5 the features:

Thread dump for Java processes 4 running as a Windows service (like Tomcat, for example), started 3 with javaw.exe, applets running inside any browser 2 or JVMs embedded inside another process. StackTrace 1 works on Windows, Linux and Mac OS X.

Score: 2

if you prefer UI based solution visualvm might be 3 a good choice. (it's advantage is also that 2 it's distributed with JDK)

To take the thread 1 dump in visualvm:

  1. connect to process (remote or local) and
  2. go for Threads (tab) -> Thread Dump (button)
Score: 0

Did you try to launch your eclipse with 5 java.exe instead of javaw.exe (in your eclipse.ini) ?

That 4 might give you the console you need, as 3 described in this bug and in this message.

Other ideas (in term 2 of java options) could be derived from this 1 other SO question.

Score: 0

You can connect through the JVisualVM and 3 get a thread dump. Just right click on the 2 application node from the Applications tree 1 and select "Thread dump"

Score: 0

On linux at least you can do a ps -ef | grep java to get the 2 PID and then do a kill -3 PID and it will output it 1 to the Eclipse console.

More Related questions