7 Replies Latest reply: Jan 13, 2012 3:52 AM by Christos Vasilakis RSS

    EAR Deployment

    Christos Vasilakis Newbie

      Hi,

       

      I am trying to install an application using ear deployment. The ear consists of

       

      svc-rrd-model  (shared model classes)

      svc-rrd-service  (switchyard app)

       

      You can have a look of the source code here

       

      https://github.com/cvasilak/svc-rrd-parent

       

      When deploying as standalone the svc-rrd-service it deploys correctly. Trying to package the jar inside an ear I get the following exception:

      12:15:59,021 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "svc-rrd-ear-1.0-SNAPSHOT.ear"

      12:15:59,372 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "svc-rrd-service.jar"

      12:15:59,465 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.unit."svc-rrd-ear-1.0-SNAPSHOT.ear".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."svc-rrd-ear-1.0-SNAPSHOT.ear".POST_MODULE: Failed to process phase POST_MODULE of deployment "svc-rrd-ear-1.0-SNAPSHOT.ear"

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]

                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.NullPointerException

                at org.switchyard.as7.extension.deployment.SwitchYardConfigProcessor.deploy(SwitchYardConfigProcessor.java:60)

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]

                ... 5 more

       

      12:15:59,697 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015856: Undeploy of deployment "svc-rrd-ear-1.0-SNAPSHOT.ear" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"svc-rrd-ear-1.0-SNAPSHOT.ear\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"svc-rrd-ear-1.0-SNAPSHOT.ear\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"svc-rrd-ear-1.0-SNAPSHOT.ear\""}}

      12:15:59,761 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Stopped deployment svc-rrd-service.jar in 63ms

      12:15:59,767 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Stopped deployment svc-rrd-ear-1.0-SNAPSHOT.ear in 70ms

      12:15:59,768 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

      JBAS014777:   Services which failed to start:      service jboss.deployment.unit."svc-rrd-ear-1.0-SNAPSHOT.ear".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."svc-rrd-ear-1.0-SNAPSHOT.ear".POST_MODULE: Failed to process phase POST_MODULE of deployment "svc-rrd-ear-1.0-SNAPSHOT.ear"

       

      12:15:59,769 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"svc-rrd-ear-1.0-SNAPSHOT.ear\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"svc-rrd-ear-1.0-SNAPSHOT.ear\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"svc-rrd-ear-1.0-SNAPSHOT.ear\""}}}}

       

       

      The svc-service class contains an EJB (Routing class) and the svc-model contains some model classes shared by the ejb and the webapp(that will be bult later). Basically I am doing the ear because I want the model classes to be packaged as an external jar shared both by the ejb and the webapp.

       

      I am using jboss-as-7.1.0.CR1b/ (latest release) with the switchyard runtime installed by the switchyard-installer

       

      Any tips?

       

      Regards,

      Christos

        • 1. Re: EAR Deployment
          Keith Babo Master

          My guess is there's a bug in our deployer for EAR deployments.  The stack trace points to an error trying to load switchyard.xml from the deployment archive.  Would you mind filing a JIRA?

           

          In terms of sharing classes between two deployments, you can do that without an EAR in AS 7.  You can deploy the shared model classes as a separate archive, then add a dependency on that deployments to each of your other deployments.  Rob has an example application which demonstrates this pattern.

           

          https://github.com/rcernich/quickstarts/tree/reporting_sample/demos/reporting

           

          The web and service modules in that application depend on the api module.  Check out the pom.xml for both web and service to see how the dependency is registered. 

           

          hth,

          keith

          • 2. Re: EAR Deployment
            Christos Vasilakis Newbie

            Hi Keith,

             

            From the pom.xml file I see that in the maven-jar plugin there is the following configuration

            <archive>

                        <manifestEntries>

                          <!-- Allows us to resolve reporting-api classes in AS7 -->

                          <Dependencies>deployment.reporting-api.jar</Dependencies>

                        </manifestEntries>

            </archive>


             

             

            Which produces in the MANIFEST.MF of the reporting-service.jar the following headers

            Dependencies: deployment.reporting-api.jar

            Class-Path: reporting-api-0.0.1-SNAPSHOT.jar

             

            I added the same configuration in my pom.xml. I have deployed the model.jar but when I am trying to deploy the service.jar I am getting

            java.lang.IllegalArgumentException: Given parent is not an ancestor of this virtual file

             

            I thought it was a misconfiguration of mine but when I tried the reporting example I get the same exception

             

            After deploying the reporting-api.jar first and then the reporting-service I get in the console.

             

            18:59:28,530 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "reporting-api-0.0.1-SNAPSHOT.jar"

            18:59:28,649 INFO  [org.jboss.weld] (MSC service thread 1-4) Processing CDI deployment: reporting-api-0.0.1-SNAPSHOT.jar

            18:59:28,712 INFO  [org.jboss.weld] (MSC service thread 1-4) Starting Services for CDI deployment: reporting-api-0.0.1-SNAPSHOT.jar

            18:59:28,898 INFO  [org.jboss.weld.Version] (MSC service thread 1-4) WELD-000900 1.1.4 (Final)

            18:59:28,921 INFO  [org.jboss.weld] (MSC service thread 1-4) Starting weld service

            18:59:29,668 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018559: Deployed "reporting-api-0.0.1-SNAPSHOT.jar"

            19:00:09,709 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "reporting-service-0.0.1-SNAPSHOT.jar"

            19:00:09,718 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."reporting-service-0.0.1-SNAPSHOT.jar".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."reporting-service-0.0.1-SNAPSHOT.jar".STRUCTURE: Failed to process phase STRUCTURE of deployment "reporting-service-0.0.1-SNAPSHOT.jar"

                      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]

                      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.IllegalArgumentException: Given parent is not an ancestor of this virtual file

                      at org.jboss.vfs.VirtualFile.getPathNameRelativeTo(VirtualFile.java:116)

                      at org.jboss.vfs.VirtualFile.getPathNameRelativeTo(VirtualFile.java:122)

                      at org.jboss.vfs.VirtualFile.getPathNameRelativeTo(VirtualFile.java:122)

                      at org.jboss.vfs.VirtualFile.getPathNameRelativeTo(VirtualFile.java:110)

                      at org.jboss.as.server.deployment.module.ManifestClassPathProcessor.createAdditionalModule(ManifestClassPathProcessor.java:193) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]

                      at org.jboss.as.server.deployment.module.ManifestClassPathProcessor.handlingExistingClassPathEntry(ManifestClassPathProcessor.java:185) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]

                      at org.jboss.as.server.deployment.module.ManifestClassPathProcessor.deploy(ManifestClassPathProcessor.java:160) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]

                      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]

                      ... 5 more

             

            19:00:09,729 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015856: Undeploy of deployment "reporting-service-0.0.1-SNAPSHOT.jar" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"reporting-service-0.0.1-SNAPSHOT.jar\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"reporting-service-0.0.1-SNAPSHOT.jar\".STRUCTURE: Failed to process phase STRUCTURE of deployment \"reporting-service-0.0.1-SNAPSHOT.jar\""}}

            19:00:09,729 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report

            JBAS014777:   Services which failed to start:      service jboss.deployment.unit."reporting-service-0.0.1-SNAPSHOT.jar".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."reporting-service-0.0.1-SNAPSHOT.jar".STRUCTURE: Failed to process phase STRUCTURE of deployment "reporting-service-0.0.1-SNAPSHOT.jar"

             

            19:00:09,731 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"reporting-service-0.0.1-SNAPSHOT.jar\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"reporting-service-0.0.1-SNAPSHOT.jar\".STRUCTURE: Failed to process phase STRUCTURE of deployment \"reporting-service-0.0.1-SNAPSHOT.jar\""}}}}

            19:00:09,734 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment reporting-service-0.0.1-SNAPSHOT.jar in 3ms

             

            Any help ?

             

            Regards

            Christos

             

            PS I will fill a JIRA for the EAR problem and I will post a link here

            • 3. Re: EAR Deployment
              Rob Cernich Master

              Hey Christos,

               

              That technique (manifest.mf/Dependencies) is useful if you are not using EAR packaging.  That allows you to deploy the archives individually while allowing resolution of the external dependency.  At this point, you could consider it a work around until the SwitchYard deployment issue with EAR files is resolved.

               

              Best,

              Rob

              • 4. Re: EAR Deployment
                Rob Cernich Master

                Missed this tidbit

                From the pom.xml file I see that in the maven-jar plugin there is the following configuration

                <archive>

                            <manifestEntries>

                              <!-- Allows us to resolve reporting-api classes in AS7 -->

                              <Dependencies>deployment.reporting-api.jar</Dependencies>

                            </manifestEntries>

                </archive>


                 

                The example code references a jar deployed as "reporting-api.jar". You need to modify that to point to your specific shared module.

                 

                Best,

                Rob

                • 5. Re: EAR Deployment
                  Christos Vasilakis Newbie

                  Hi Rob

                   

                  I tried adding the specific jar version e.g.

                   

                  <archive>

                            <manifest>

                                      <addClasspath>true</addClasspath>

                            </manifest>

                            <manifestEntries>

                                      <!-- Allows us to resolve svc-rrd-model classes in AS7 -->

                                      <Dependencies>deployment.svc-rrd-model-1.0-SNAPSHOT.jar</Dependencies>

                            </manifestEntries>

                  </archive>

                   

                  but I got the same error

                  Caused by: java.lang.IllegalArgumentException: Given parent is not an ancestor of this virtual file

                   

                  Regards,

                  Christos

                  • 6. Re: EAR Deployment
                    Christos Vasilakis Newbie

                    After removing the  <addClasspath>true</addClasspath> it worked!

                     

                    I am going to get myself a beer now!

                     

                    Regards,

                    Christos

                    • 7. Re: EAR Deployment
                      Christos Vasilakis Newbie

                      just for completeness of this thread, the JIRA issue is

                       

                      https://issues.jboss.org/browse/SWITCHYARD-612

                       

                      Regards