0 Replies Latest reply on Jan 18, 2012 7:35 AM by r.reimann

    JAX-WS handler chain file inside EJB-Jar not recognized while using WAR packaging (AS7.1.0.CR1)

    r.reimann

      I've got an EJB-Jar module with an EJB3 stateless session bean as JAX-WS endpoint. The endpoint references a handler chain via @HandlerChain annotation. While deploying the WAR the following exception is thrown.

       

      12:50:09,379 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-16) MSC00001: Failed to start service jboss.deployment.unit."jaxws-injection-ejb3.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."jaxws-injection-ejb3.war".PARSE: Failed to process phase PARSE of deployment "jaxws-injection-ejb3.war"
                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.1.0.Final-SNAPSHOT.jar:7.1.0.Final-SNAPSHOT]
                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_29]
                at java.lang.Thread.run(Thread.java:680) [:1.6.0_29]
      Caused by: java.lang.IllegalStateException
                at org.jboss.as.webservices.util.ASHelper.getRequiredAttachment(ASHelper.java:166)
                at org.jboss.as.webservices.deployers.WSIntegrationProcessorJAXWS_HANDLER.processAnnotation(WSIntegrationProcessorJAXWS_HANDLER.java:55)
                at org.jboss.as.webservices.deployers.AbstractIntegrationProcessorJAXWS.deploy(AbstractIntegrationProcessorJAXWS.java:87)
                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.Final-SNAPSHOT.jar:7.1.0.Final-SNAPSHOT]
                ... 5 more
      

       

      As far as i can tell from looking at the corresponding AS7 code the exception means that the handler chain file wasn't found. I could reproduce the issue by adding the code below to the existing AS7 integration test:

      https://github.com/jbossas/jboss-as/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ws/injection/ejb/basic/InjectionTestCase.java

      and deploying the exported jaxws-injection-ejb3.war against nightly build #402.

       

              WebArchive ejb3War = ShrinkWrap.create(WebArchive.class, "jaxws-injection-ejb3.war");
              ejb3War.addAsLibraries(sharedJar);
              ejb3War.addAsLibraries(ejb3Jar);
              java.io.File tempDirectory = new java.io.File("/Users/rr/Downloads/_tmp");
              ejb3War.as(org.jboss.shrinkwrap.api.exporter.ZipExporter.class).exportTo(new java.io.File(tempDirectory, ejb3War.getName()), true);
              System.out.println(ejb3War.toString(true));
      

       

      I'm not sure if this is a bug or if the kind of packaging i'm trying is not yet covered by the current specs since as far as i remember JAX-WS predated JavaEE6 which introduced the possibility to package EJB-Jars inside a WAR.