Applies to:
Oracle Weblogic Server – Version: 8.1 and later [Release: and later ]
Information in this document applies to any platform.
Purpose
This article provides information about different ways on taking java thread dumps in a Weblogic Server environment.
Different ways to take thread dumps in WebLogic Server
WebLogic Server (WLS) and Java offer several ways to generate thread dumps, which are listed below in order of preference. It’s always better to obtain the thread dumps by using operating system (OS) commands rather than by using Java classes or the Administration Console, because if the console is hanging, users won’t be able to connect to it to issue thread dumps.
- Use operating system commands to get the thread dumps:
- On Windows OSes, thread dumps can be created by
<ctrl>+<break> the thread dumps are generated in the server stdout - On Unix, first identify the process ID (pid) using
ps -ef | grep java, then runkill -3 pid > td_filename 2>&1
- On Windows OSes, thread dumps can be created by
- Using beasvc:
- service_name is the Windows service that is running the server instance (e.g. mydomain_myserver)
- td_pathname is the full path and the name of the file in which the thread dump will be generated into
- Using weblogic.WLST:
java weblogic.WLST
connect("username","password","t3://<url>:<port>")
threadDump()
the thread dump will be generated in Thread_Dump_AdminServer.txt
- From a command line or shell, a thread dump can be generated via the following command:
java weblogic.Admin <url>:<port> -username <username> -password <password> THREAD_DUMPThe thread dump will be generated in the server stdout defined
- From the WLS Administration Console a thread dump can be created by navigating to Server -> <server_name> -> Monitoring -> Dump threads stack. This method could lead to truncated thread dumps or incomplete thread dump.
- From the JRockit command line:
jrcmd <pid> print_threads
beasvc -dump -svcname:service_name -log:td_pathname
Related posts:
- How Do I Prevent Losing My Principal When a Thread Dies During JNDI Authentication?
- Is It Normal to See Blocked “weblogic.socket.muxer” Threads?
- WLS 8.1 SP1 – WTC forced shutdown during transactional activity -> recovery makes WLS not working – CR187873
- Deadlock Detected On An Application Written In Cocoon Framework
Need to get thread dumps.
I used kill -3 pid > td_filename 2 >&1.. The file is created but nothing in it
Please help me ..