Bug 61214 - NoSuchMethodException in JMX Proxy when accessing to Context MBeans
Summary: NoSuchMethodException in JMX Proxy when accessing to Context MBeans
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Manager (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-24 21:49 UTC by Alexis Hassler
Modified: 2017-06-26 12:44 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis Hassler 2017-06-24 21:49:01 UTC
The servlets attribute is still in the StandardContext mbean but is no longer in the org.apache.catalina.core.StandardContext class.

Here is the stacktrace :
----
24-Jun-2017 23:41:41.058 SEVERE [http-nio-8080-exec-1] org.apache.catalina.mbeans.MBeanDumper.dumpBeans Error getting attribute Catalina:j2eeType=WebModule,name=//localhost/host-manager,J2EEApplication=none,J2EEServer=none servlets
 javax.management.ReflectionException: Cannot find getter method getServlets
	at org.apache.tomcat.util.modeler.ManagedBean.getGetter(ManagedBean.java:458)
	at org.apache.tomcat.util.modeler.BaseModelMBean.getAttribute(BaseModelMBean.java:180)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:647)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:678)
	at org.apache.catalina.mbeans.MBeanDumper.dumpBeans(MBeanDumper.java:81)
	at org.apache.catalina.manager.JMXProxyServlet.listBeans(JMXProxyServlet.java:185)
	at org.apache.catalina.manager.JMXProxyServlet.doGet(JMXProxyServlet.java:121)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:592)
	at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:319)
	at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:88)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:625)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:498)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:796)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1372)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodException: org.apache.catalina.core.StandardContext.getServlets()
	at java.lang.Class.getMethod(Class.java:1786)
	at org.apache.tomcat.util.modeler.ManagedBean.getGetter(ManagedBean.java:451)
	... 32 more
----
Comment 1 Alexis Hassler 2017-06-24 21:56:12 UTC
PR sent
Comment 2 Mark Thomas 2017-06-26 12:17:08 UTC
Thanks for the report and the PR. This has been fixed in trunk and will be included in 9.0.0.M23 onwards.
Comment 3 Violeta Georgieva 2017-06-26 12:23:56 UTC
Hi Mark,

I think that this should be backported to 8.5.x as this functionality (JSR77) was removed there also.

Regards,
Violeta
Comment 4 Mark Thomas 2017-06-26 12:44:17 UTC
Thanks for the heads up. I did check 8.5.x and thought the method was still there but I didn't check carefully enough.

Fixed in 8.5.x for 8.5.17 onwards.