6 Replies Latest reply on Sep 15, 2004 6:42 AM by Lothar Egger

    isolate war deployment

    metadjer Newbie

      I would like to isolate my war deployment respecting to the classic servlet 2.3 class loading model (load the classes from the child scope first: WEB-INF/class + WEB-INF/lib first, then load the classes from the parent scope).



      Here is my jboss-web.xml:
      <jboss-web>
      <!-- Isolate the application classes from other deployments
      -->
      <class-loading>
      <loader-repository java2ClassLoadingCompliance="false">
      app.TracerTrac:loader=TracerTrac.war
      <loader-repository-config>java2ParentDelegaton=true</loader-repository-config>
      </loader-repository>
      </class-loading>
      </jboss-web>



      Nevertheless, somhow the war classloader is loading the classes from the parent scope first.

      Here is the error:
      10:10:42,829 ERROR [ActionServlet] Parsing error processing resource path /WEB-INF/struts-config.xml
      java.lang.NoClassDefFoundError: org/apache/commons/digester/ObjectCreationFactory
      at org.apache.commons.digester.Digester.addFactoryCreate(Digester.java:2044)
      at org.apache.commons.digester.Digester.addFactoryCreate(Digester.java:1936)
      at org.apache.struts.config.ConfigRuleSet.addRuleInstances(ConfigRuleSet.java:121)
      at org.apache.commons.digester.Digester.addRuleSet(Digester.java:1663)
      at org.apache.struts.action.ActionServlet.initConfigDigester(ActionServlet.java:1211)
      at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:923)
      at org.apache.struts.action.ActionServlet.init(ActionServlet.java:465)
      at javax.servlet.GenericServlet.init(GenericServlet.java:211)
      ...



      The conflict is about the jar: commons-digester.jar located under: MyWebApp/WEB-INF/lib and jbossweb-tomcat50.sar


      Here are the JMX console traces:
      class: org.apache.commons.digester.ObjectCreationFactory
      class info from JMX:
      org.apache.commons.digester.ObjectCreationFactory Information
      Repository cache version:
      org.apache.commons.digester.ObjectCreationFactory(e0c07c).ClassLoader=org.jboss.mx.loading.UnifiedClassLoader3@1181df3{ url=file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39976TracerTrac.war/ ,addedOrder=33}
      ..org.jboss.mx.loading.UnifiedClassLoader3@1181df3{ url=file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39976TracerTrac.war/ ,addedOrder=33}
      ....file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39976TracerTrac.war/
      ....file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39976TracerTrac.war/WEB-INF/classes/
      .............
      ....file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39976TracerTrac.war/WEB-INF/lib/commons-digester.jar
      .............
      ++++CodeSource: (file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39976TracerTrac.war/WEB-INF/lib/commons-digester.jar <no certificates>)
      Implemented Interfaces:

      ### Instance0 found in UCL: org.jboss.mx.loading.UnifiedClassLoader3@1181df3{ url=file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39976TracerTrac.war/ ,addedOrder=33}


      class: org.apache.commons.digester.Digester
      class info from JMX:
      org.apache.commons.digester.Digester Information
      Repository cache version:
      org.apache.commons.digester.Digester(19e3e24).ClassLoader=org.jboss.mx.loading.UnifiedClassLoader3@134263a{ url=file:/C:/jboss-3.2.4/server/default/deploy/jbossweb-tomcat50.sar/ ,addedOrder=5}
      ..org.jboss.mx.loading.UnifiedClassLoader3@134263a{ url=file:/C:/jboss-3.2.4/server/default/deploy/jbossweb-tomcat50.sar/ ,addedOrder=5}
      ....file:/C:/jboss-3.2.4/server/default/deploy/jbossweb-tomcat50.sar/
      ....file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39926ant.jar
      ....file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39927catalina-manager.jar
      ....file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39928catalina-optional.jar
      ....file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39929catalina.jar
      ....file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39930commons-beanutils.jar
      ....file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39931commons-collections.jar
      ....file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39932commons-digester.jar
      ...............
      ++++CodeSource: (file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39932commons-digester.jar <no certificates>)
      Implemented Interfaces:

      ### Instance0 found in UCL: org.jboss.mx.loading.UnifiedClassLoader3@1181df3{ url=file:/C:/jboss-3.2.4/server/default/tmp/deploy/tmp39976TracerTrac.war/ ,addedOrder=33}

      So please, Help !

      Regards

      Kamel

        • 1. Re: isolate war deployment
          Pedro Salazar Newbie

          Kamel,

          I think you are facing the same problem as I do. I didn't have any luck configure the class loading politic through jboss-web.xml (or jboss-app.xml) even when the unique domain for the class loading is created.

          The only way I could manage to work is changing the configurations in jboss's tomcat itself. I know that the best way would be configure it per application and not for all applications (I'm still looking for the answer as you are).

          The attributes I managed in configuration file $jboss_home/server/all/deploy/jbossweb-tomcat50.sar/META-INF/jboss-service.xml:

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


          Does it help for you as workaround?
          (I'm still looking for the procedure to do it on jboss-web.xm/jboss-app.xml but I really don't know why it isn't work...).

          Regards,
          Pedro Salazar.

          • 2. Re: isolate war deployment
            Scott Stark Master

            java2ParentDelegation must be false to load from the war before the parent.

            <class-loading java2ClassLoadingCompliance="false">
             <loader-repository>
             app.TracerTrac:loader=TracerTrac.war
             <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
             </loader-repository>
            </class-loading>
            


            • 3. Re: isolate war deployment
              metadjer Newbie

              Now since i have set the flags Java2ClassLoadingCompliance and UseJBossWebLoader to false in the jboss-service.xml file of jbossweb-tomcat50.sar, i am faced to the following problem:

              15:04:32,380 ERROR [BaseModelMBean] Exception invoking method addChild
              javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
              at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:99)
              at org.apache.commons.modeler.util.DomUtil.readXml(DomUtil.java:284)
              at org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource.execute(MbeansDescriptorsDOMSource.java:130)
              at org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource.loadDescriptors(MbeansDescriptorsDOMSource.java:120)
              at org.apache.commons.modeler.Registry.load(Registry.java:819)
              at org.apache.commons.modeler.Registry.loadDescriptors(Registry.java:931)
              at org.apache.commons.modeler.Registry.loadDescriptors(Registry.java:909)
              at org.apache.commons.modeler.Registry.findDescriptor(Registry.java:992)
              at org.apache.commons.modeler.Registry.findManagedBean(Registry.java:696)
              at org.apache.commons.modeler.Registry.findManagedBean(Registry.java:1047)
              at org.apache.commons.modeler.Registry.registerComponent(Registry.java:859)
              at org.apache.catalina.loader.WebappLoader.init(WebappLoader.java:612)
              at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:644)
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:4209)
              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              ....................

              15:04:32,650 ERROR [WebModule] Starting failed jboss.web.deployment:war=invoker.war,id=-595404997
              org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (MBeanException: Exception invoking method init
              Cause: LifecycleException: Pipeline has not been started)
              at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:315)
              at org.jboss.web.WebModule.startModule(WebModule.java:62)
              at org.jboss.web.WebModule.startService(WebModule.java:40)
              ....................

              Caused by: MBeanException: Exception invoking method init
              Cause: LifecycleException: Pipeline has not been started
              at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:517)
              at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:109)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
              at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:267)
              at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:68)
              at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:306)
              ... 139 more
              Caused by: LifecycleException: Pipeline has not been started
              at org.apache.catalina.core.StandardPipeline.stop(StandardPipeline.java:268)
              at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4494)
              at org.apache.catalina.core.ContainerBase.destroy(ContainerBase.java:1213)
              at org.apache.catalina.core.StandardContext.destroy(StandardContext.java:4573)
              at org.apache.catalina.core.StandardContext.init(StandardContext.java:5415)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:324)
              at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
              ... 144 more
              15:04:32,650 WARN [ServiceController] Problem starting service jboss.web.deployment:war=invoker.war,id=-595404997
              MBeanException: org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (MBeanException: Exception invoking method init
              Cause: LifecycleException: Pipeline has not been started)
              Cause: org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (MBeanException: Exception invoking method init
              Cause: LifecycleException: Pipeline has not been started)
              at org.jboss.mx.server.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:91)
              at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:64)
              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(ServiceController.java:837)
              at $Proxy33.start(Unknown Source)
              ....................

              Caused by: org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (MBeanException: Exception invoking method init
              Cause: LifecycleException: Pipeline has not been started)
              at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:315)
              at org.jboss.web.WebModule.startModule(WebModule.java:62)
              at org.jboss.web.WebModule.startService(WebModule.java:40)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
              at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:324)
              at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
              ... 131 more
              Caused by: MBeanException: Exception invoking method init
              Cause: LifecycleException: Pipeline has not been started
              at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:517)
              at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:109)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
              at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:267)
              at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:68)
              at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:306)
              ... 139 more
              Caused by: LifecycleException: Pipeline has not been started
              at org.apache.catalina.core.StandardPipeline.stop(StandardPipeline.java:268)
              at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4494)
              at org.apache.catalina.core.ContainerBase.destroy(ContainerBase.java:1213)
              at org.apache.catalina.core.StandardContext.destroy(StandardContext.java:4573)
              at org.apache.catalina.core.StandardContext.init(StandardContext.java:5415)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:324)
              at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
              ... 144 more
              15:04:32,670 ERROR [MainDeployer] could not start deployment: file:/C:/jboss-3.2.4/server/default/deploy/http-invoker.sar/invoker.war/
              org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (MBeanException: Exception invoking method init
              Cause: LifecycleException: Pipeline has not been started)
              at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:315)
              at org.jboss.web.WebModule.startModule(WebModule.java:62)
              at org.jboss.web.WebModule.startService(WebModule.java:40)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
              at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:324)
              ...................

              Incompletely deployed packages:
              org.jboss.deployment.DeploymentInfo@dc82d73b { url=file:/C:/jboss-3.2.4/server/default/deploy/http-invoker.sar/invoker.war/ }
              deployer: org.jboss.web.tomcat.tc5.Tomcat5@659812
              status: Deployment FAILED reason: Error during deploy; - nested throwable: (MBeanException: Exception invoking method init
              Cause: LifecycleException: Pipeline has not been started)
              state: FAILED
              watch: file:/C:/jboss-3.2.4/server/default/deploy/http-invoker.sar/invoker.war/WEB-INF/web.xml
              lastDeployed: 1093611871929
              lastModified: 1089206507326
              mbeans:

              MBeans waiting for other MBeans:
              ObjectName: jboss.web.deployment:war=invoker.war,id=-595404997
              state: FAILED
              I Depend On:
              Depends On Me: MBeanException: org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (MBeanException: Exception invoking method init
              Cause: LifecycleException: Pipeline has not been started)
              Cause: org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (MBeanException: Exception invoking method init
              Cause: LifecycleException: Pipeline has not been started)

              MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
              ObjectName: jboss.web.deployment:war=invoker.war,id=-595404997
              state: FAILED
              I Depend On:
              Depends On Me: MBeanException: org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (MBeanException: Exception invoking method init
              Cause: LifecycleException: Pipeline has not been started)
              Cause: org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (MBeanException: Exception invoking method init
              Cause: LifecycleException: Pipeline has not been started)

              • 4. Re: isolate war deployment
                metadjer Newbie

                Hi Scott,

                I had tried also to set the attribute java2ParentDelegation to false, but then i encountered the following issue:

                15:36:19,767 ERROR [Context] Error reading tld listeners javax.servlet.ServletException: Exception processing TLD at resource path /WEB-INF/extensions.tld in context /TracerTrac
                javax.servlet.ServletException: Exception processing TLD at resource path /WEB-INF/extensions.tld in context /TracerTrac
                at org.apache.catalina.startup.TldConfig.tldScanTld(TldConfig.java:548)
                at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:300)
                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4260)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
                ..................
                15:36:20,137 ERROR [Engine] StandardContext[/TracerTrac]StandardWrapper.Throwable
                java.lang.IncompatibleClassChangeError
                at org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:197)
                at org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
                at org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1276)
                at org.apache.struts.action.ActionServlet.init(ActionServlet.java:459)
                at javax.servlet.GenericServlet.init(GenericServlet.java:211)
                at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1019)
                at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
                at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3991)
                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4335)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
                ..................
                15:36:20,137 ERROR [Engine] StandardContext[/TracerTrac]Servlet /TracerTrac threw load() exception
                javax.servlet.ServletException: Servlet.init() for servlet action threw exception
                at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1061)
                at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
                at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3991)
                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4335)
                .................
                15:36:20,137 ERROR [Engine] ----- Root Cause -----
                java.lang.IncompatibleClassChangeError
                at org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:197)
                at org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
                at org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1276)
                at org.apache.struts.action.ActionServlet.init(ActionServlet.java:459)
                at javax.servlet.GenericServlet.init(GenericServlet.java:211)


                Actually, whatever is the configuration, i have new side effects.

                Oh, i forgot to specify that i am using the version 3.2.4 of JBoss.

                Regards

                Kamel

                • 5. Re: isolate war deployment
                  metadjer Newbie

                  Please help !!

                  I am still stuck by this problem !

                  Whatever is the configuration, the class loading is not compliant to the documentation ...

                  Any idea ?

                  Maybe it is a bug of the version 3.2.x ...

                  Thx for any help !

                  Kamel