Author: kkolinko
Date: Mon Dec 8 05:13:48 2014
New Revision: 1643737
URL: http://svn.apache.org/r1643737
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57261
Change /vminfo and /threaddump Manager commands to print an "OK -" line, thus
aligning them with other commands. Document them.
Merged r1643731 from tomcat/trunk.
Modified:
tomcat/tc8.0.x/trunk/ (props changed)
tomcat/tc8.0.x/trunk/java/org/apache/catalina/manager/LocalStrings.properties
tomcat/tc8.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java
tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml
tomcat/tc8.0.x/trunk/webapps/docs/manager-howto.xml
Propchange: tomcat/tc8.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 8 05:13:48 2014
@@ -1 +1 @@
-/tomcat/trunk:1636524,1637156,1637176,1637188,1637331,1637684,1637695,1638720-1638725,1639653,1640010,1640084,1640088,1640275,1640322,1640347,1640361,1640365,1640403,1640410,1640652,1640655-1640658,1640688,1640700-1640883,1640903,1640976,1640978,1641000,1641026,1641038-1641039,1641051-1641052,1641058,1641064,1641300,1641369,1641374,1641380,1641486,1641634,1641656-1641692,1641704,1641707-1641718,1641720-1641722,1641735,1641981,1642554,1642564,1642595,1642606,1642668,1642679,1642697,1642699,1643002,1643045,1643054-1643055,1643066,1643121,1643206,1643209-1643210,1643216,1643249,1643270,1643283,1643309-1643310,1643323,1643365-1643366,1643370-1643371,1643465,1643474,1643570,1643634,1643649,1643651,1643654,1643675
+/tomcat/trunk:1636524,1637156,1637176,1637188,1637331,1637684,1637695,1638720-1638725,1639653,1640010,1640084,1640088,1640275,1640322,1640347,1640361,1640365,1640403,1640410,1640652,1640655-1640658,1640688,1640700-1640883,1640903,1640976,1640978,1641000,1641026,1641038-1641039,1641051-1641052,1641058,1641064,1641300,1641369,1641374,1641380,1641486,1641634,1641656-1641692,1641704,1641707-1641718,1641720-1641722,1641735,1641981,1642554,1642564,1642595,1642606,1642668,1642679,1642697,1642699,1643002,1643045,1643054-1643055,1643066,1643121,1643206,1643209-1643210,1643216,1643249,1643270,1643283,1643309-1643310,1643323,1643365-1643366,1643370-1643371,1643465,1643474,1643570,1643634,1643649,1643651,1643654,1643675,1643731
Modified:
tomcat/tc8.0.x/trunk/java/org/apache/catalina/manager/LocalStrings.properties
URL:
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/manager/LocalStrings.properties?rev=1643737&r1=1643736&r2=1643737&view=diff
==============================================================================
---
tomcat/tc8.0.x/trunk/java/org/apache/catalina/manager/LocalStrings.properties
(original)
+++
tomcat/tc8.0.x/trunk/java/org/apache/catalina/manager/LocalStrings.properties
Mon Dec 8 05:13:48 2014
@@ -111,7 +111,9 @@ managerServlet.sslConnectorCiphers=OK -
managerServlet.started=OK - Started application at context path {0}
managerServlet.startFailed=FAIL - Application at context path {0} could not be
started
managerServlet.stopped=OK - Stopped application at context path {0}
+managerServlet.threaddump=OK - JVM thread dump
managerServlet.undeployed=OK - Undeployed application at context path {0}
managerServlet.unknownCommand=FAIL - Unknown command {0}
+managerServlet.vminfo=OK - VM info
statusServlet.title=Server Status
statusServlet.complete=Complete Server Status
Modified:
tomcat/tc8.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java
URL:
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java?rev=1643737&r1=1643736&r2=1643737&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java
(original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java
Mon Dec 8 05:13:48 2014
@@ -114,6 +114,7 @@ import org.apache.tomcat.util.res.String
* context path <code>/xxx</code> for this virtual host.</li>
* <li><b>/stop?path=/xxx</b> - Stop the web application attached to
* context path <code>/xxx</code> for this virtual host.</li>
+ * <li><b>/threaddump</b> - Write a JVM thread dump.</li>
* <li><b>/undeploy?path=/xxx</b> - Shutdown and remove the web application
* attached to context path <code>/xxx</code> for this virtual host,
* and remove the underlying WAR file or document base directory.
@@ -121,6 +122,7 @@ import org.apache.tomcat.util.res.String
* base is stored in the <code>appBase</code> directory of this host,
* typically as a result of being placed there via the <code>/deploy</code>
* command.</li>
+ * <li><b>/vminfo</b> - Write some VM info.</li>
* </ul>
* <p>Use <code>path=/</code> for the ROOT context.</p>
* <p>The syntax of the URL for a web application archive must conform to one
@@ -364,9 +366,9 @@ public class ManagerServlet extends Http
} else if (command.equals("/findleaks")) {
findleaks(statusLine, writer, smClient);
} else if (command.equals("/vminfo")) {
- vmInfo(writer, request.getLocales());
+ vmInfo(writer, smClient, request.getLocales());
} else if (command.equals("/threaddump")) {
- threadDump(writer, request.getLocales());
+ threadDump(writer, smClient, request.getLocales());
} else if (command.equals("/sslConnectorCiphers")) {
sslConnectorCiphers(writer, smClient);
} else {
@@ -537,8 +539,9 @@ public class ManagerServlet extends Http
*
* @param writer
*/
- protected void vmInfo(PrintWriter writer,
+ protected void vmInfo(PrintWriter writer, StringManager smClient,
Enumeration<Locale> requestedLocales) {
+ writer.println(smClient.getString("managerServlet.vminfo"));
writer.print(Diagnostics.getVMInfo(requestedLocales));
}
@@ -548,8 +551,9 @@ public class ManagerServlet extends Http
*
* @param writer
*/
- protected void threadDump(PrintWriter writer,
+ protected void threadDump(PrintWriter writer, StringManager smClient,
Enumeration<Locale> requestedLocales) {
+ writer.println(smClient.getString("managerServlet.threaddump"));
writer.print(Diagnostics.getThreadDump(requestedLocales));
}
Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1643737&r1=1643736&r2=1643737&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Mon Dec 8 05:13:48 2014
@@ -206,6 +206,11 @@
(kkolinko)
</fix>
<fix>
+ <bug>57261</bug>: Fix vminfo and threaddump Manager commands to start
+ their output with an "OK" line. Document them. Based on a patch by
+ Oleg Trokhov. (kkolinko)
+ </fix>
+ <fix>
<bug>57323</bug>: Correct display of outdated sessions in sessions
count listing in Manager application. (kkolinko)
</fix>
Modified: tomcat/tc8.0.x/trunk/webapps/docs/manager-howto.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/manager-howto.xml?rev=1643737&r1=1643736&r2=1643737&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/webapps/docs/manager-howto.xml (original)
+++ tomcat/tc8.0.x/trunk/webapps/docs/manager-howto.xml Mon Dec 8 05:13:48 2014
@@ -878,6 +878,61 @@ Connector[HTTP/1.1-8443]
</subsection>
+<subsection name="Thread Dump">
+
+<source>http://localhost:8080/manager/text/threaddump</source>
+
+<p>Write a JVM thread dump.</p>
+
+<p>The response will look something like this:</p>
+<source><![CDATA[OK - JVM thread dump
+2014-12-08 07:24:40.080
+Full thread dump Java HotSpot(TM) Client VM (25.25-b02 mixed mode):
+
+"http-nio-8080-exec-2" Id=26 cpu=46800300 ns usr=46800300 ns blocked 0 for -1
ms waited 0 for -1 ms
+ java.lang.Thread.State: RUNNABLE
+ locks java.util.concurrent.ThreadPoolExecutor$Worker@1738ad4
+ at sun.management.ThreadImpl.dumpThreads0(Native Method)
+ at sun.management.ThreadImpl.dumpAllThreads(ThreadImpl.java:446)
+ at
org.apache.tomcat.util.Diagnostics.getThreadDump(Diagnostics.java:440)
+ at
org.apache.tomcat.util.Diagnostics.getThreadDump(Diagnostics.java:409)
+ at
org.apache.catalina.manager.ManagerServlet.threadDump(ManagerServlet.java:557)
+ at
org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:371)
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
+...
+]]></source>
+
+</subsection>
+
+<subsection name="VM Info">
+
+<source>http://localhost:8080/manager/text/vminfo</source>
+
+<p>Write some diagnostic information about Java Virtual Machine.</p>
+
+<p>The response will look something like this:</p>
+<source><![CDATA[OK - VM info
+2014-12-08 07:27:32.578
+Runtime information:
+ vmName: Java HotSpot(TM) Client VM
+ vmVersion: 25.25-b02
+ vmVendor: Oracle Corporation
+ specName: Java Virtual Machine Specification
+ specVersion: 1.8
+ specVendor: Oracle Corporation
+ managementSpecVersion: 1.2
+ name: ...
+ startTime: 1418012458849
+ uptime: 393855
+ isBootClassPathSupported: true
+
+OS information:
+...
+]]></source>
+
+</subsection>
+
</section>
<section name="Server Status">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]