- 论坛徽章:
- 0
|
<DIV>
<P>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.</P>
<OL>
<LI>Use operating system commands to get the thread dumps when WLS starts up from a command-line script:<BR>
<UL>
<LI>On Windows OSes, thread dumps can be created by
<DIV class=kmcodeblock style="BORDER-RIGHT: rgb(196,209,230) 1px solid; PADDING-RIGHT: 0.5em; BORDER-TOP: rgb(196,209,230) 1px solid; OVERFLOW-Y: auto; PADDING-LEFT: 0.5em; OVERFLOW-X: auto; PADDING-BOTTOM: 0.5em; MARGIN: 5px 0px 0px; BORDER-LEFT: rgb(196,209,230) 1px solid; WIDTH: 95%; PADDING-TOP: 0.5em; BORDER-BOTTOM: rgb(196,209,230) 1px solid; BACKGROUND-COLOR: rgb(238,243,247)">+ <EM>the thread dumps are generated in the server stdout</EM></DIV>
<LI>On POSIX compliant platforms (e.g. Solaris and Linux), first identify the process ID (<EM>pid</EM>) using ps -ef | grep java, then run
<DIV class=kmcodeblock style="BORDER-RIGHT: rgb(196,209,230) 1px solid; PADDING-RIGHT: 0.5em; BORDER-TOP: rgb(196,209,230) 1px solid; OVERFLOW-Y: auto; PADDING-LEFT: 0.5em; OVERFLOW-X: auto; PADDING-BOTTOM: 0.5em; MARGIN: 5px 0px 0px; BORDER-LEFT: rgb(196,209,230) 1px solid; WIDTH: 95%; PADDING-TOP: 0.5em; BORDER-BOTTOM: rgb(196,209,230) 1px solid; BACKGROUND-COLOR: rgb(238,243,247)">kill -3 <EM>pid </EM>> td_filename 2>&1 </DIV>Signal 3 is equivalent to SIGQUIT. </LI></UL>
<LI>Using beasvc:
<DIV class=kmcodeblock style="BORDER-RIGHT: rgb(196,209,230) 1px solid; PADDING-RIGHT: 0.5em; BORDER-TOP: rgb(196,209,230) 1px solid; OVERFLOW-Y: auto; PADDING-LEFT: 0.5em; OVERFLOW-X: auto; PADDING-BOTTOM: 0.5em; MARGIN: 5px 0px 0px; BORDER-LEFT: rgb(196,209,230) 1px solid; WIDTH: 95%; PADDING-TOP: 0.5em; BORDER-BOTTOM: rgb(196,209,230) 1px solid; BACKGROUND-COLOR: rgb(238,243,247)">beasvc -dump -svcname:<EM>service_name</EM> -log:<EM>td_pathname</EM></DIV>
<UL>
<LI><EM>service_name </EM>is the Windows service that is running the server instance (e.g. mydomain_myserver)
<LI><EM>td_pathname </EM>is the full path and the name of the file in which the thread dump will be generated into </LI></UL>
<LI>Using weblogic.WLST:<BR>
<DIV class=kmcodeblock style="WIDTH: 95%">setDomain.cmd or setDomain.sh depending on the OS<BR>java weblogic.WLST <BR>connect("<EM>username"</EM>,"<EM>password"</EM>,"t3://:") <BR>threadDump() <BR></DIV>the thread dump will be generated in Thread_Dump_AdminServer.txt
<LI>From a command line or shell, a thread dump can be generated via the following command <EM>(deprecated from WLS 9.0)</EM>:<BR>
<DIV class=kmcodeblock style="WIDTH: 95%">setDomain.cmd or setDomain.sh depending on the OS<BR>java weblogic.Admin : -username -password THREAD_DUMP</DIV>The thread dump will be generated in the server stdout defined
<LI>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.
<LI>From the JRockit command line:
<DIV class=kmcodeblock style="WIDTH: 95%">jrcmd print_threads</DIV></LI></OL></DIV>
<P> </P>
<P>转自:<A href="https://support.oracle.com/" target=_blank>https://support.oracle.com</A></P>
<P>wlst内容参考:<A href="http://download.oracle.com/docs/cd/E13222_01/wls/docs92/config_.ing/index.html" target=_blank>http://download.oracle.com/docs/cd/E13222_01/wls/docs92/config_scripting/index.html</A></P> |
|