5 Replies Latest reply on Jan 29, 2011 5:14 AM by pieter.martin

    Servlet Lifecycle event not firing in ear

    pieter.martin

      Hi,


      I am running an ear application on jboss.6.0.0.Final. Both seam-servlet-api-3.0.0.Alpha3.jar and seam-servlet-impl-3.0.0.Alpha3.jar is in the lib directory. I have the following bean



      public class StartUp {
           public void startup(@Observes @Initialized ServletContext ctx) {
                System.out.println("Ssssssssssssssssssssssss");
           }
      


      The method never gets called.


      I have a arquillian test case deploying a war archive and then it works.


      Is this a bug or is some configuration missing?


      Thanks
      Pieter

        • 1. Re: Servlet Lifecycle event not firing in ear
          pieter.martin

          Hi,


          Ok I put the jars in the ear's lib which is rather silly for a servlet api. I have moved it to the both the api and impl to the war's WEB-INF/lib. Now I am getting the following exception on startup.


          ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to 
          Start: name=vfs:///home/pieter/jboss-6.0.0.Final/server/default/deploy/nakedumltest.ear_WeldBootstrapBean 
          state=Create: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [ServletExtension] 
          with qualifiers [@Default] at injection point [[parameter 2] of [method] @Produces @TypedParamValue protected
           
          org.jboss.seam.servlet.http.CookieParamProducer.getTypedParamValue(InjectionPoint, ServletExtension)]
               at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:305) [:6.0.0.Final]
          



          Any ideas what I am doing wrong?
          Thanks
          Pieter

          • 2. Re: Servlet Lifecycle event not firing in ear
            lightguard

            I'm not sure about ear deployments, I haven't tried them yet.  Just out of curiosity, what is driving you to use an ear?

            • 3. Re: Servlet Lifecycle event not firing in ear
              pieter.martin

              I have been wondering if its worthwhile, seeing that almost all the test cases are packaged as wars? I am refactoring/upgrading an existing system that is packaged as an ear which contains a bunch of ejb modules packaged separately in the ear so decided without much investigation to go for an ear.

              • 4. Re: Servlet Lifecycle event not firing in ear
                lightguard

                As long as there aren't any remote EJBs in the archive you can safely package everything up in a war now :)

                • 5. Re: Servlet Lifecycle event not firing in ear
                  pieter.martin

                  Thanks