Bug 54247 - Exception in JmxRemoteLifecycleListener.destroyServer
Summary: Exception in JmxRemoteLifecycleListener.destroyServer
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.33
Hardware: PC Windows Server 2003
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-05 10:00 UTC by Benoît REY
Modified: 2013-01-02 20:41 UTC (History)
0 users



Attachments
Tomcat log (first stop with service manager, second stop with shutdown port) (7.72 KB, application/octet-stream)
2012-12-05 10:00 UTC, Benoît REY
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benoît REY 2012-12-05 10:00:36 UTC
Created attachment 29697 [details]
Tomcat log (first stop with service manager, second stop with shutdown port)

Tomcat 7.0.33 is installed as Windows service and is using JDK 1.7.0_09.
JmxRemoteLifecycleListener is used :
<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" 
		rmiRegistryPortPlatform="8999" rmiServerPortPlatform="9999" />

When Tomcat is stopped through the Windows service manager or the Common Daemon Service Manager, the JmxRemoteLifecycleListener listener fail to stop with the following exception :

05-Dec-2012 10:44:49.306 SEVERE [Thread-36] org.apache.catalina.mbeans.JmxRemoteLifecycleListener.destroyServer The JMX connector server could not be stopped for the Platform server
 java.io.IOException: Cannot bind to URL: javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.naming.java.javaURLContextFactory [Root exception is java.lang.ClassNotFoundException: org/apache/naming/java/javaURLContextFactory]
	at javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:826)
	at javax.management.remote.rmi.RMIConnectorServer.stop(RMIConnectorServer.java:569)
	at org.apache.catalina.mbeans.JmxRemoteLifecycleListener.destroyServer(JmxRemoteLifecycleListener.java:282)
	at org.apache.catalina.mbeans.JmxRemoteLifecycleListener.lifecycleEvent(JmxRemoteLifecycleListener.java:226)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
	at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:347)
	at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:748)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
	at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:486)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:371)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:453)
Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.naming.java.javaURLContextFactory [Root exception is java.lang.ClassNotFoundException: org/apache/naming/java/javaURLContextFactory]
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
	at javax.naming.InitialContext.init(InitialContext.java:242)
	at javax.naming.InitialContext.<init>(InitialContext.java:216)
	at javax.management.remote.rmi.RMIConnectorServer.stop(RMIConnectorServer.java:558)
	... 15 more
Caused by: java.lang.ClassNotFoundException: org/apache/naming/java/javaURLContextFactory
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:63)
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
	... 19 more

If Tomcat is stopped through the use of the shutdown port, the JmxRemoteLifecycleListener listener stop gently.
Comment 1 Mark Thomas 2013-01-02 20:41:31 UTC
Thanks for the report. This has been fixed in trunk and 7.0.x and will be included in 7.0.35 onwards.