4 Replies Latest reply on Mar 14, 2011 12:07 AM by dan.j.allen

    Error installing to PostClassLoader with seam-servlet-3.0.0.CR1

    dhinojosa

      Trying to run seam-servlet 3.0.0.CR1 in JAS 6.0.0.Final and ended up with the following errors.


      20:38:38,866 ERROR [AbstractKernelController] Error installing to PostClassLoader: name=vfs:///home/danno/java/jboss-6.0.0.Final/server/default/deploy/cdi-scala_2.8.1-1.0.war state=ClassLoader mode=Manual requiredState=PostClassLoader: org.jboss.deployers.spi.DeploymentException: Deployment error processing fragment for JAR: seam-servlet-3.0.0.CR1.jar
           at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.0.GA]
           at org.jboss.web.deployers.MergedJBossWebMetaDataDeployer.deploy(MergedJBossWebMetaDataDeployer.java:394) [:6.0.0.Final]
           at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]
           at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]
           at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]
           at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]
           at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]
           at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
           at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]
           at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]
           at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]
           at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
           at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]
           at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]
           at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]
           at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]
           at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:112) [:0.2.2]
           at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:87) [:0.2.2]
           at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2]
           at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.0.0.Final]
           at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]
           at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
           at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
           at java.lang.Thread.run(Thread.java:636) [:1.6.0_20]
      Caused by: java.lang.IllegalStateException: Unresolved conflict on load on startup
           at org.jboss.metadata.web.spec.ServletMetaData.augment(ServletMetaData.java:308) [:2.0.0.CR1]
           at org.jboss.metadata.web.spec.ServletsMetaData.augment(ServletsMetaData.java:46) [:2.0.0.CR1]
           at org.jboss.metadata.web.spec.WebCommonMetaData.augment(WebCommonMetaData.java:847) [:2.0.0.CR1]
           at org.jboss.web.deployers.MergedJBossWebMetaDataDeployer.deploy(MergedJBossWebMetaDataDeployer.java:390) [:6.0.0.Final]
           ... 44 more
      



      and further down the stack


      DEPLOYMENTS IN ERROR:
        Deployment "vfs:///home/danno/java/jboss-6.0.0.Final/server/default/deploy/cdi-scala_2.8.1-1.0.war" is in error due to the following reason(s): java.lang.IllegalStateException: Unresolved conflict on load on startup
      
           at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.GA]
           at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.GA]
           at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.Final]
           at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]
           at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.0.0.Final]
           at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]
           at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
           at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
           at java.lang.Thread.run(Thread.java:636) [:1.6.0_20]
      



      Here is the setup in my war file.


      .
      ├── index.html
      ├── rock.html
      └── WEB-INF
          ├── beans.xml
          ├── classes
          │   └── com
          │       └── evolutionnext
          │           └── cdiscala
          │               └── servlet
          │                   ├── ExampleServlet.class
          │                   └── ServletContextLifecycleEventListener.class
          ├── jboss-scanning.xml
          ├── lib
          │   ├── joda-time-1.6.2.jar
          │   ├── joda-time-1.6.2-sources.jar
          │   ├── scala-library.jar
          │   ├── seam-servlet-3.0.0.CR1.jar
          │   └── seam-servlet-3.0.0.CR1-sources.jar
          └── web.xml
      



      FYI, jboss-scanning.xml is used to keep the class-loader from scouring the scala-library. It's contents are as follows:


      <scanning xmlns="urn:jboss:scanning:1.0">
        <path name="WEB-INF/lib/scala-library.jar">
           <exclude name="scala" recurse="true"/>
        </path>
      </scanning>
      



      One thing I did notice is the statement


      Deployment error processing fragment for JAR: seam-servlet-3.0.0.CR1.jar
      



      There is a closed and satisfied Jira Filed : JBAS-8767 . I am not sure the bug was actually fixed for JBoss AppServer 6.0.0.Final, but I do have this issue.

        • 1. Re: Error installing to PostClassLoader with seam-servlet-3.0.0.CR1
          dan.j.allen

          Having a reference to the name of a non-existent web fragment was treated as a deployment error in JBoss AS 6 prior to final. That was fixed by JBAS-8767, as you pointed out. However, now we get the same problem on GlassFish 3.1. It comes down to the fact that the specification was not clear about how to handle this case, and so the situation is undefined. So I guess we'll have to disable it.


          You may wonder why we need the reference at all. In an EE application server, we can assume that CDI will be available when the context initialized event is fired. However, when using CDI in a Servlet container, as provided by Weld Servlet, the ordering is not guaranteed. We hoped to be able to include an ordering hint so that Seam Servlet web components would be registered after the Weld Servlet web components using this fragment in Seam Servlet:



             <ordering>
                <after>
                   <name>WeldServlet</name>
                </after>
                <before>
                   <others/>
                </before>
             </ordering>



          Alas, as you've observed, GlassFish 3.1 chokes if there is no web fragment named WeldServlet in the deployment. That's really irritating, but it's life. We'll either wait for it to be resolved or come up with another way to guarantee the order. Worse case scenario, you'll have to add some manual configuration.


          I'll create issue reports shortly.

          • 2. Re: Error installing to PostClassLoader with seam-servlet-3.0.0.CR1
            dan.j.allen

            Actually, at the moment, the ordering isn't a problem since Weld Servlet doesn't use a web fragment. I was planning for the future, prematurely :)

            • 3. Re: Error installing to PostClassLoader with seam-servlet-3.0.0.CR1
              dan.j.allen

              Seam Servlet issue: SEAMSERVLET-29

              • 4. Re: Error installing to PostClassLoader with seam-servlet-3.0.0.CR1
                dan.j.allen

                GlassFish issue: GLASSFISH-16201