You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/11/19 18:08:42 UTC

[Bug 54170] New: JMX ObjectName for Filters: names used without quoting (escaping)

https://issues.apache.org/bugzilla/show_bug.cgi?id=54170

            Bug ID: 54170
           Summary: JMX ObjectName for Filters: names used without quoting
                    (escaping)
           Product: Tomcat 7
           Version: 7.0.26
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: benjamin.gehrels_external@immobilienscout24.de
    Classification: Unclassified

How to reproduce:
Execute 

context.addFilter("deprecatedApiReporterFilterFor/myAPI/v2/*, new
ArbitraryServletFilter()).addMappingForUrlPatterns(null, false, "/myAPI/v2/*");

from inside the contextInitialized-Method of an ServletContextListener.


What happens:
Nov 19, 2012 6:01:34 PM org.apache.catalina.core.ApplicationFilterConfig
registerJMX
Information: JMX registration failed for filter of type
[ArbitraryServletFilter] and name [deprecatedApiReporterFilterFor/myAPI/v2/*]
javax.management.RuntimeOperationsException
    at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:411)
    at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
    at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
    at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
    at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
    at
com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:512)
    at
org.apache.tomcat.util.modeler.Registry.registerComponent(Registry.java:742)
    at
org.apache.catalina.core.ApplicationFilterConfig.registerJMX(ApplicationFilterConfig.java:432)
    at
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
    at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
    at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4638)
    at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
    at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
    at
org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalArgumentException: Repository: cannot add mbean for
pattern name
Catalina:j2eeType=Filter,name=deprecatedApiReporterFilterFor/myAPI/v2/*,WebModule=//localhost/,J2EEApplication=none,J2EEServer=none
    ... 24 more

Why does it happen:

Because ApplicationFilterConfig constructs the ObjectName by String
concatenation, without escaping the filterName using ObjectName.quote(String s)

I was able to reproduce it using Catalina 7.0.26.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 54170] JMX ObjectName for Filters: names used without quoting (escaping)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54170

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
                 OS|                            |All

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Thanks for the report. Fixed in trunk and 7.0.x and will be included in 7.0.34
onwards.

Servlets were affected as well as Filters. Both were fixed.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org