Author: markt
Date: Fri Apr 25 16:22:45 2014
New Revision: 1590077
URL: http://svn.apache.org/r1590077
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56418
Ensure that the Manager web application does not report success for a web
application deployment that fails. Based on a patch by slaurent.
Modified:
tomcat/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1590076
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java?rev=1590077&r1=1590076&r2=1590077&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/manager/ManagerServlet.java
Fri Apr 25 16:22:45 2014
@@ -718,15 +718,7 @@ public class ManagerServlet extends Http
return;
}
- context = (Context) host.findChild(name);
- if (context != null && context.getConfigured()) {
- writer.println(smClient.getString(
- "managerServlet.deployed", displayPath));
- } else {
- // Something failed
- writer.println(smClient.getString(
- "managerServlet.deployFailed", displayPath));
- }
+ writeDeployResult(writer, smClient, name, displayPath);
}
@@ -784,16 +776,7 @@ public class ManagerServlet extends Http
return;
}
- context = (Context) host.findChild(name);
- if (context != null && context.getConfigured()) {
- writer.println(smClient.getString("managerServlet.deployed",
- displayPath));
- } else {
- // Something failed
- writer.println(smClient.getString("managerServlet.deployFailed",
- displayPath));
- }
-
+ writeDeployResult(writer, smClient, name, displayPath);
}
@@ -901,19 +884,7 @@ public class ManagerServlet extends Http
removeServiced(name);
}
}
- context = (Context) host.findChild(name);
- if (context != null && context.getConfigured() &&
- context.getState().isAvailable()) {
- writer.println(smClient.getString(
- "managerServlet.deployed", displayPath));
- } else if (context!=null && !context.getState().isAvailable()) {
- writer.println(smClient.getString(
- "managerServlet.deployedButNotStarted", displayPath));
- } else {
- // Something failed
- writer.println(smClient.getString(
- "managerServlet.deployFailed", displayPath));
- }
+ writeDeployResult(writer, smClient, name, displayPath);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
log("ManagerServlet.install[" + displayPath + "]", t);
@@ -924,6 +895,24 @@ public class ManagerServlet extends Http
}
+ private void writeDeployResult(PrintWriter writer, StringManager smClient,
+ String name, String displayPath) {
+ Context deployed = (Context) host.findChild(name);
+ if (deployed != null && deployed.getConfigured() &&
+ deployed.getState().isAvailable()) {
+ writer.println(smClient.getString(
+ "managerServlet.deployed", displayPath));
+ } else if (deployed!=null && !deployed.getState().isAvailable()) {
+ writer.println(smClient.getString(
+ "managerServlet.deployedButNotStarted", displayPath));
+ } else {
+ // Something failed
+ writer.println(smClient.getString(
+ "managerServlet.deployFailed", displayPath));
+ }
+ }
+
+
/**
* Render a list of the currently active Contexts in our virtual host.
*
Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1590077&r1=1590076&r2=1590077&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri Apr 25 16:22:45 2014
@@ -232,6 +232,10 @@
Correct documentation on Windows service options, aligning it with
Apache Commons Daemon documentation. (kkolinko)
</fix>
+ <fix>
+ <bug>56418</bug>: Ensure that the Manager web application does not
+ report success for a web application deployment that fails. (slaurent)
+ </fix>
</changelog>
</subsection>
<subsection name="Other">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]