6.5.2011 20:54:01 org.apache.catalina.startup.HostConfig checkResources INFO: Undeploying context [/test] 6.5.2011 20:54:01 org.apache.catalina.startup.HostConfig checkResources WARNING: Error while removing context [/test] java.lang.NullPointerException at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:923) at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1212) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1380) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:306) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1385) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1649) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1658) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1638) at java.lang.Thread.run(Thread.java:662)
Steps to reproduce: 1) Get commit https://github.com/OndraZizka/arquillian-container-tomcat/commit/35fa744834d23c190f25d70466813fcd9e741544 2) Start Tomcat server with JMX on port 9876 (see arquillian.xml) 3) Build the tomcat6-remote-container tests
Hmm. That looks like Arquillian is doing things it shouldn't and mixing auto-deployment with directly removing a Context from a Host via JMX. I have proposed some NPE protection so Tomcat will handle this more gracefully but it looks like the root cause lies elsewhere.
> I have proposed some NPE protection Regarding the proposed Tomcat 6 patch (backport of r943112): It is good per se, for any Container.removeChild() call, but won't be enough here. > java.lang.NullPointerException > at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:923) > at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1212) The patch will cure the removeChild(null) call at HostConfig.java:1212, but several lines later (1218) there is context.destroy() call that will result in the same NPE. This is specific to TC6, as trunk does not call destroy() there.
First patch applied. Still need to address the additional issue Konstantin identified.
Thanks. This is part of https://issues.jboss.org/browse/ARQ-262 I will check the undeployment method eventually.
Created attachment 27228 [details] Additional patch for Tomcat 6 This patch addresses the additional NPE identified by Konstantin.
This has been fixed in 6.0.x and will be included in 6.0.33 onwards.