{"id":412,"date":"2016-02-11T20:11:49","date_gmt":"2016-02-11T14:41:49","guid":{"rendered":"http:\/\/www.middlewareprimer.com\/blog\/?p=412"},"modified":"2016-02-11T20:11:49","modified_gmt":"2016-02-11T14:41:49","slug":"different-ways-to-take-thread-dumps-in-weblogic-server","status":"publish","type":"post","link":"http:\/\/www.middlewareprimer.com\/blog\/2016\/02\/11\/different-ways-to-take-thread-dumps-in-weblogic-server\/","title":{"rendered":"Different ways to take thread dumps in Weblogic Server"},"content":{"rendered":"<p><span id=\"pt1:r1:ot71\">Different ways to take thread dumps in Weblogic Server are detailed below. \u00a0It is always recommended 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 hung, users won&#8217;t be able to connect to it to issue thread dumps.<br \/>\n<\/span><\/p>\n<p><strong>1.Use operating system commands to get the thread dumps when WLS starts up from a command-line script:<\/strong><\/p>\n<ul>\n<li>On Windows OSes, thread dumps can be created by\n<div class=\"kmcodeblock\">&lt;ctrl&gt;+&lt;break&gt; &#8212; <em>the thread dumps are generated in the server stdout<\/em><\/div>\n<\/li>\n<li>On POSIX-compliant platforms (e.g. Solaris and Linux), first identify the process ID (<em>pid<\/em>) usingps -ef | grep java, then run\n<div class=\"kmcodeblock\">kill -3 &lt;pid&gt; 2&gt;&amp;1<\/div>\n<\/li>\n<li>\n<div class=\"kmcodeblock\">Signal 3 is equivalent to SIGQUIT. Note that in Solaris, the thread dump is generated in the current shell, but in Linux, the thread dump is generated in the shell which started the java process specified by the pid.<\/div>\n<\/li>\n<\/ul>\n<p><strong>2.Using beasvc (up to WLS 10.3.5 included):<\/strong><\/p>\n<div class=\"kmcodeblock\">beasvc -dump -svcname:&lt;service_name&gt;<\/div>\n<ul>\n<li><em>service_name<\/em> is the Windows service that is running the server instance (e.g. mydomain_myserver)<\/li>\n<\/ul>\n<p><strong>3.Using wlsve (from 10.3.6\/12.1.1):<\/strong><\/p>\n<div class=\"kmcodeblock\">wlsve -dump -svcname:&lt;service_name&gt;<\/div>\n<p><strong>4.Using weblogic.WLST:<\/strong><\/p>\n<div class=\"kmcodeblock\">setDomain.cmd or setDomain.sh depending on the OS<br \/>\njava weblogic.WLST<br \/>\nconnect(&#8220;&lt;username&gt;&#8221;,&#8221;&lt;password&gt;&#8221;,&#8221;t3:\/\/&lt;url&gt;:&lt;port&gt;&#8221;)<br \/>\nthreadDump()<\/div>\n<p>The thread dump will be generated in Thread_Dump_AdminServer.txt.<\/p>\n<p><strong>5.From a command line or shell, a thread dump can be generated via the following command <em>(deprecated from WLS 9.0)<\/em>:<\/strong><\/p>\n<div class=\"kmcodeblock\">setDomain.cmd or setDomain.sh depending on the OS<br \/>\njava weblogic.Admin &lt;url&gt;:&lt;port&gt; -username &lt;username&gt; -password &lt;password&gt; THREAD_DUMP<\/div>\n<p>The thread dump will be generated in the defined server stdout.<\/p>\n<p><strong>6<\/strong>.From the WLS Administration Console, a thread dump can be created by navigating to Server -&gt; &lt;server_name&gt; -&gt; Monitoring -&gt; Dump threads stack. This method could lead to truncated or incomplete thread dumps.<\/p>\n<p><strong>7<\/strong>.From the Services Administration Tools when WLS runs as a Windows Service,<\/p>\n<p><strong>8<\/strong>.Java VisualVM can also be used to take thread dumps while applications are running.<\/p>\n<p><strong>9<\/strong>.With jstack<\/p>\n<div class=\"kmcodeblock\">jstack &lt;pid&gt; or jstack -l &lt;pid&gt; to print additional information about locks<\/div>\n<p><strong>10.From the JRockit command line:<\/strong><\/p>\n<div class=\"kmcodeblock\">jrcmd &lt;pid&gt; print_threads<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Different ways to take thread dumps in Weblogic Server are detailed below. \u00a0It is always recommended 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 hung, users won&#8217;t be able to connect to it to issue thread dumps. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[99],"tags":[110,102],"class_list":["post-412","post","type-post","status-publish","format-standard","hentry","category-weblogic","tag-thread-dumps","tag-weblogic"],"_links":{"self":[{"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/posts\/412","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/comments?post=412"}],"version-history":[{"count":6,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/posts\/412\/revisions"}],"predecessor-version":[{"id":432,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/posts\/412\/revisions\/432"}],"wp:attachment":[{"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/media?parent=412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/categories?post=412"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/tags?post=412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}