Author: markt
Date: Thu Nov 22 15:02:31 2012
New Revision: 1412576
URL: http://svn.apache.org/viewvc?rev=1412576&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54170
Ensure correct registration of Filters and Servlets in the JMX registry if the
Filter or Servlet name includes a character that must be quoted if used in an
ObjectName value.
Added:
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/modeler/Util.java
- copied unchanged from r1412575,
tomcat/trunk/java/org/apache/tomcat/util/modeler/Util.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestApplicationFilterConfig.java
- copied unchanged from r1412575,
tomcat/trunk/test/org/apache/catalina/core/TestApplicationFilterConfig.java
Modified:
tomcat/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapper.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1412575
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java?rev=1412576&r1=1412575&r2=1412576&view=diff
==============================================================================
---
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
(original)
+++
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
Thu Nov 22 15:02:31 2012
@@ -43,6 +43,7 @@ import org.apache.tomcat.InstanceManager
import org.apache.tomcat.util.ExceptionUtils;
import org.apache.tomcat.util.log.SystemLogHandler;
import org.apache.tomcat.util.modeler.Registry;
+import org.apache.tomcat.util.modeler.Util;
import org.apache.tomcat.util.res.StringManager;
@@ -416,16 +417,19 @@ public final class ApplicationFilterConf
String webMod = "//" + hostName + parentName;
String onameStr = null;
+ String filterName = filterDef.getFilterName();
+ if (Util.objectNameValueNeedsQuote(filterName)) {
+ filterName = ObjectName.quote(filterName);
+ }
if (context instanceof StandardContext) {
StandardContext standardContext = (StandardContext) context;
- onameStr = domain + ":j2eeType=Filter,name=" +
- filterDef.getFilterName() + ",WebModule=" + webMod +
- ",J2EEApplication=" +
+ onameStr = domain + ":j2eeType=Filter,name=" + filterName +
+ ",WebModule=" + webMod + ",J2EEApplication=" +
standardContext.getJ2EEApplication() + ",J2EEServer=" +
standardContext.getJ2EEServer();
} else {
- onameStr = domain + ":j2eeType=Filter,name=" +
- filterDef.getFilterName() + ",WebModule=" + webMod;
+ onameStr = domain + ":j2eeType=Filter,name=" + filterName +
+ ",WebModule=" + webMod;
}
try {
oname = new ObjectName(onameStr);
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapper.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapper.java?rev=1412576&r1=1412575&r2=1412576&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapper.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardWrapper.java Thu
Nov 22 15:02:31 2012
@@ -69,6 +69,7 @@ import org.apache.tomcat.PeriodicEventLi
import org.apache.tomcat.util.ExceptionUtils;
import org.apache.tomcat.util.log.SystemLogHandler;
import org.apache.tomcat.util.modeler.Registry;
+import org.apache.tomcat.util.modeler.Util;
/**
* Standard implementation of the <b>Wrapper</b> interface that represents
@@ -1851,7 +1852,11 @@ public class StandardWrapper extends Con
StringBuilder keyProperties =
new StringBuilder("j2eeType=Servlet,name=");
- keyProperties.append(getName());
+ String name = getName();
+ if (Util.objectNameValueNeedsQuote(name)) {
+ name = ObjectName.quote(name);
+ }
+ keyProperties.append(name);
keyProperties.append(getWebModuleKeyProperties());
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=1412576&r1=1412575&r2=1412576&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Thu Nov 22 15:02:31 2012
@@ -59,6 +59,11 @@
<fix>
Fix unit test for AccessLogValve when using non-GMT time zone. (rjung)
</fix>
+ <fix>
+ <bug>54170</bug>: Ensure correct registration of Filters and Servlets
in
+ the JMX registry if the Filter or Servlet name includes a character
that
+ must be quoted if used in an ObjectName value. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Other">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]