Monday, August 28, 2006

getting thread dumps out of WebLogic 9.1

I've solved far too many technical issues that remain undocumented. This blog is my attempt to log useful solutions to issues I have run across, as they happen. Our first entry is not of my authoring.

Here’s some useful information on getting thread dumps out of WebLogic 9.1 (good luck looking for the thread dumps if you ‘kill –QUIT’ on the JVM pid):

Add the following variables to your environment:

1. Set the following environment variables in your shell:

CLASSPATH=${BEA_HOME}/patch_weblogic910/profiles/default/sys_manifest_classpath/weblogic_patch.jar:${BEA_HOME}/jdk150_04/lib/tools.jar:${BEA_HOME}/weblogic91/server/lib/weblogic_sp.jar:${BEA_HOME}/weblogic91/server/lib/weblogic.jar:${BEA_HOME}/weblogic91/server/lib/webservices.jar

PATH=${BEA_HOME}/weblogic91/server/bin:${BEA_HOME}/jdk150_04/jre/bin:${BEA_HOME}/jdk150_04/bin:${PATH}

2. Use the WebLogic WebLogic Scripting Tool (WLST) and connect to the server of interest:

# java weblogic.WLST

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> connect('weblogic', 'weblogic', 't3://sunmdm7:8095')

Connecting to weblogic server instance running at t3://sunmdm7:8095 as username weblogic ...

Successfully connected to Admin Server 'mdm-8095' that belongs to domain 'mdm_mdm-8095'.

Warning: An insecure protocol was used to connect to the server.

To ensure on-the-wire security, the SSL port or Admin port

should be used instead.

3. Use the WLST command threadDump()

Syntax

threadDump([writeToFile], [fileName], [serverName])

Argument

Definition

writeToFile

Optional. Boolean value specifying whether to save the output to a file. This argument defaults to true, indicating that output is saved to a file.

fileName

Optional. Name of the file to which the output is written. The filename can be absolute or relative to the directory where WLST is running. This argument defaults to Thread_Dump_serverName file, where serverName indicates the name of the server. This argument is valid only if writeToFile is set to true.

serverName

Optional. Server name for which the thread dump is requested. This argument defaults to the server to which WLST is connected.

If you are connected to an Administration Server, you can display a thread dump for the Administration Server and any Managed Server that is running in the domain. If you are connected to a Managed Server, you can only display a thread dump for that Managed Server.

wls:/mdm_mdm-8095/serverConfig> threadDump()

Thread dump for the running server: mdm-8095

"[STANDBY] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'" waiting for lock weblogic.work.ExecuteThread@af71f0 WAITING

java.lang.Object.wait(Native Method)

java.lang.Object.wait(Object.java:474)

weblogic.work.ExecuteThread.waitForRequest(ExecuteThread.java:163)

weblogic.work.ExecuteThread.run(ExecuteThread.java:184)

"[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'" waiting for lock weblogic.work.ExecuteThread@61806f WAITING

java.lang.Object.wait(Native Method)

java.lang.Object.wait(Object.java:474)

weblogic.work.ExecuteThread.waitForRequest(ExecuteThread.java:163)

weblogic.work.ExecuteThread.run(ExecuteThread.java:184)

"[STANDBY] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'" waiting for lock weblogic.work.ExecuteThread@1373527 WAITING

java.lang.Object.wait(Native Method)

java.lang.Object.wait(Object.java:474)

weblogic.work.ExecuteThread.waitForRequest(ExecuteThread.java:163)

weblogic.work.ExecuteThread.run(ExecuteThread.java:184)

"Timer-11" waiting for lock java.util.TaskQueue@182b8fe TIMED_WAITING

java.lang.Object.wait(Native Method)

java.util.TimerThread.mainLoop(Timer.java:509)

java.util.TimerThread.run(Timer.java:462)

"DynamicListenThread[Default]" RUNNABLE native

java.net.PlainSocketImpl.socketAccept(Native Method)

java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)

java.net.ServerSocket.implAccept(ServerSocket.java:450)

java.net.ServerSocket.accept(ServerSocket.java:421)

weblogic.socket.WeblogicServerSocket.accept(WeblogicServerSocket.java:34

. . . .

No comments: