Saturday, December 14, 2013

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.
1.Use operating system commands to get the thread dumps: On Windows OS, thread dumps can be created by + the thread dumps are generated in the server stdoutOn Unix, first identify the process ID (pid) using ps -ef | grep java, then run kill -3 pid
2.Using beasvc:
o service_name is the Windows service that is running the server instance (e.g. mydomain_myserver)
o td_pathname is the full path and the name of the file in which the thread dump will be generated into
beasvc -dump -svcname:service_name -log:td_pathname
3. Using weblogic.WLST:
java weblogic.WLST
connect("username","password","t3://:")
threadDump()
the thread dump will be generated in Thread_Dump_AdminServer.txt
4.From a command line or shell, a thread dump can be generated via the following command:
java weblogic.Admin : -username -password THREAD_DUMP
The thread dump will be generated in the server stdout defined
5.From the WLS Administration Console a thread dump can be created by navigating to Server -> -> Monitoring -> Dump threads stack. This method could lead to truncated thread dumps or incomplete thread dump.
6.From the JRockit command line: jrcmd print_threads

No comments:

Post a Comment