Bug 65135 - mbeans-descriptors.xml missing attribute for parallelAnnotationScanning
Summary: mbeans-descriptors.xml missing attribute for parallelAnnotationScanning
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 9.0.41
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-10 16:58 UTC by Michael Cramer
Modified: 2021-02-12 13:47 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Cramer 2021-02-10 16:58:55 UTC
when the "parallelAnnotationScanning" property was introduced in StandardContext the descriptor file mbeans-descriptors.xml was also changed
see https://github.com/apache/tomcat/commit/101476c3536ac09a105d0b603b2c51dd0f3770e9 but is missing the `is="true"` attribute. without that attribute all calls to the JmxProxyServlet are causing an error that is written to the catalina.out


10-Feb-2021 17:43:56.703 SCHWERWIEGEND [http-nio-8080-exec-1] org.apache.catalina.mbeans.MBeanDumper.dumpBeans Error getting attribute [parallelAnnotationScanning] for object name [Catalina:j2eeType=WebModule,name=//localhost/example,J2EEApplication=none,J2EEServer=none]
	javax.management.ReflectionException: Cannot find getter method [getParallelAnnotationScanning] on resource [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/example]]
		at org.apache.tomcat.util.modeler.ManagedBean.getGetter(ManagedBean.java:457)
		at org.apache.tomcat.util.modeler.BaseModelMBean.getAttribute(BaseModelMBean.java:168)
		at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:641)
		at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:678)
		at org.apache.catalina.mbeans.MBeanDumper.dumpBeans(MBeanDumper.java:87)
		at org.apache.catalina.manager.JMXProxyServlet.listBeans(JMXProxyServlet.java:193)
		at org.apache.catalina.manager.JMXProxyServlet.doGet(JMXProxyServlet.java:129)
		at javax.servlet.http.HttpServlet.service(HttpServlet.java:626)
		at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
                ...
	Caused by: java.lang.NoSuchMethodException: org.apache.catalina.core.StandardContext.getParallelAnnotationScanning()
		at java.base/java.lang.Class.getMethod(Class.java:2201)
		at org.apache.tomcat.util.modeler.ManagedBean.getGetter(ManagedBean.java:450)
		... 57 more

the get method is defined in StandardContext as `boolean isParallelAnnotationScanning()` but because of the missing is=true it Is expected to find a method `boolean getParallelAnnotationScanning()`

this bug is present in all versions since 9.0.39
Comment 1 Remy Maucherat 2021-02-12 13:47:38 UTC
The use of "is" is error prone here, it slipped by in a PR. The method is now using "get" instead, with a deprecated "is" still staying for a while.
The fix will be in Tomcat 9.0.44 and 10.0.3.