6 Replies Latest reply on Aug 12, 2004 8:02 AM by Lothar Egger

    Struts unload() causes NPE

    Randahl Fink Isaksen Novice

      Using JBoss 3.2.5 and struts 1.1 I keep getting exceptions when the destroy method of Struts' action servlet is invoked. I did not experience this on earlier versions of JBoss even though I had the same configuration as now.

      Has anyone else experienced this? Below is my stack trace.

      Randahl


      16:14:22,953 ERROR [Engine] StandardContext[]Servlet action threw unload() excep
      tion
      javax.servlet.ServletException: Servlet.destroy() for servlet action threw excep
      tion
      at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:
      1258)
      at org.apache.catalina.core.StandardWrapper.stop(StandardWrapper.java:15
      70)
      at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java
      :952)
      at org.apache.catalina.core.StandardContext.removeChild(StandardContext.
      java:3126)
      at org.apache.catalina.startup.ContextConfig.stop(ContextConfig.java:676
      )
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfi
      g.java:218)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
      eSupport.java:119)
      at org.apache.catalina.core.StandardContext.stop(StandardContext.java:44
      87)
      at org.apache.catalina.core.ContainerBase.destroy(ContainerBase.java:121
      3)
      at org.apache.catalina.core.StandardContext.destroy(StandardContext.java
      :4573)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:582)
      at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:
      503)
      at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:1
      09)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatD
      eployer.java:142)
      at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.
      java:70)
      at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:306)

      at org.jboss.web.WebModule.startModule(WebModule.java:62)
      at org.jboss.web.WebModule.startService(WebModule.java:40)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
      upport.java:271)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
      eanSupport.java:221)
      at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:582)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
      java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:837)
      at $Proxy17.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:367)
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:582)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
      java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy31.start(Unknown Source)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:31
      3)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:836)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:828)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:645)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:608)
      at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:582)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
      java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:304)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:460)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      run(AbstractDeploymentScanner.java:191)
      16:14:23,031 ERROR [Engine] ----- Root Cause -----
      java.lang.NullPointerException
      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:143)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLo
      ader3.java:178)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader
      3.java:132)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:236)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:303)
      at org.apache.struts.action.ActionServlet.destroyModules(ActionServlet.j
      ava:719)
      at org.apache.struts.action.ActionServlet.destroy(ActionServlet.java:430
      )
      at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:
      1245)
      at org.apache.catalina.core.StandardWrapper.stop(StandardWrapper.java:15
      70)
      at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java
      :952)
      at org.apache.catalina.core.StandardContext.removeChild(StandardContext.
      java:3126)
      at org.apache.catalina.startup.ContextConfig.stop(ContextConfig.java:676
      )
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfi
      g.java:218)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
      eSupport.java:119)
      at org.apache.catalina.core.StandardContext.stop(StandardContext.java:44
      87)
      at org.apache.catalina.core.ContainerBase.destroy(ContainerBase.java:121
      3)
      at org.apache.catalina.core.StandardContext.destroy(StandardContext.java
      :4573)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:582)
      at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:
      503)
      at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:1
      09)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatD
      eployer.java:142)
      at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.
      java:70)
      at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:306)

      at org.jboss.web.WebModule.startModule(WebModule.java:62)
      at org.jboss.web.WebModule.startService(WebModule.java:40)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
      upport.java:271)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
      eanSupport.java:221)
      at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:582)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
      java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:837)
      at $Proxy17.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:367)
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:582)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
      java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy31.start(Unknown Source)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:31
      3)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:836)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:828)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:645)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:608)
      at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:582)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
      java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:304)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:460)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      run(AbstractDeploymentScanner.java:191)

        • 1. Re: Struts unload() causes NPE
          Christian Bjørnbak Newbie

          Yes, I experience the same error periodically. I can't find a way to reproduce the error on command...

          I use Struts too, but I hadn't linked the error to Struts...

          • 2. Re: Struts unload() causes NPE
            Randahl Fink Isaksen Novice

            Sure it is related to Struts. Look:

            "Servlet action threw unload()"

            And in my system the servlet name "action" refers to the Struts action servlet. This is confirmed by the fact that if I disable struts, the problem goes away. As soon as struts is enabled, the error occurs - even if I disable all my own struts stuff and run a clean, fresh struts install the error occurs...

            Anyone got any ideas?

            Randahl

            • 3. Re: Struts unload() causes NPE
              Lothar Egger Newbie

              hi randahl

              yes, some ideas ;)

              be ABSOLUT sure that all your apps use the SAME struts version

              you can try to use the tomcat specific class loader..
              (that may help !?)
              edit: /deploy/jbossweb-tomcat50.sar/META-INF/jboss-service.xml

              <attribute name="UseJBossWebLoader">false</attribute>


              I/we had several problems with several struts/jboss versions

              i use jboss3.2.5 and struts 1.2.1 and struts-layout-latest and Tomcat Webloader.
              everything works fine now.

              cheers
              L



              • 4. Re: Struts unload() causes NPE
                Randahl Fink Isaksen Novice

                Unfortunately setting this to false yields a huge amount of FileNotFoundExceptions related to different kinds of ".bsh" files like the following

                java.io.FileNotFoundException: C:\jboss-3.2.5\server\shared\tmp\de
                ploy\tmp17849web-console.war\WEB-INF\classes\SystemFolder.bsh

                I tried wiping the deploy folder but this leads to even more errors like

                java.io.FileNotFoundException: C:\jboss-3.2.5\server\shared\work\j
                boss.web\localhost\_\loader\org\apache\struts\resources\struts-config_1_1.dtd

                For now I will go back to using the UseJBossWebLoader=true setting. - Why did you think this was the solution in the first place, and do you have any idea why it leads to the exceptions above?

                • 5. Re: Struts unload() causes NPE
                  Randahl Fink Isaksen Novice

                  By the way you did mean struts 1.1, right? Not 1.2.1?

                  I am using struts 1.1 and its jar is in the web-inf/lib folder of my war.

                  Randahl

                  • 6. Re: Struts unload() causes NPE
                    Lothar Egger Newbie

                    hi randahl

                    we use "struts 1.2.1"

                    UseJBossWebLoader: A flag indicating if the class loader used by Tomcat as the web application class loader is a JBoss unified class loader. The default is true, and this means that the classes available in the war inside of the WEB-INF/classes and WEB-INF/jars are incorporated into the default shared class loader repository described in chapter 2. This may not be what you want as its contrary to the default servlet 3.2 class loading model and can result in sharing of classes/resources between web applications. You can disable this by setting this attribute to false.


                    different struts versions in wars,ears... what a mess ;)
                    ... we had problems with sharing struts things between apps, so we used
                    UseJBossWebLoader "false".



                    we use the "all" configuration ..
                    you have to restart jboss if you change the UseJBossWebLoader..
                    clean the tmp and work directory after shutdown..

                    cheers
                    L