1 Reply Latest reply on Jan 16, 2013 2:05 AM by kpiwko

    Deployment failure with JBoss 7.1.0.Final and Arquillian 1.0.3.Final

    nsx241

      I have a strange deployment failure error with trying to deploy my test archive into JBoss. Using eclipse indigo at the moment, my war file is created in createDeployment as:

       

      @Deployment

      public static Archive<?> createDeployment() throws Exception {

       

      WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war")

               .addClass(AccountSignupServiceTest.class)  

               .addAsResource("test/test-persistence.xml", "META-INF/persistence.xml")

               .addAsWebInfResource(new File("server/appweb/deploy/appweb.war/WEB-INF/jboss-deployment-structure.xml"), "jboss-deployment-structure.xml")

                        .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")

                        .addAsWebInfResource(new File("configuration/war/WEB-INF/web.xml"), "web.xml");

       

      loadResources("resources", "", war);

       

      }

       

      private static void loadResources(String baseDir, String dirToScan, WebArchive war) {

                          File dir = new File(baseDir + "/" + dirToScan);

       

                          for (File f : dir.listFiles(new FileFilter() {

                                    @Override

                                    public boolean accept(File pathname) {

                                              return !pathname.getName().endsWith(".svn") && !filterFileName(pathname.getName().toLowerCase());

                                    }}

                          )) {

                                    String target = f.getPath().substring(baseDir.length() + 1);

       

                                    if (f.isDirectory()) {

                                              loadResources(baseDir, target, war);

                                    }

                                    else {

                                              war.addAsWebInfResource(f, "classes/" + target);

                                    }

                          }

                }


       

      The loadResources method basically adds all the additional resources that exist in the actual appweb.war (the application itself, that is). The structure inside of appweb.war/test.war is along the lines of:

       

      META-INF

           |

           |__ ...

       

      WEB-INF

           |

           |__ classes

                     |

                     |__ com

                     |

                     |__ emailTemplates

                     |

                     |__ ...

       

      Inside of emailTemplates is essentially a bunch of directories containing html and txt files.

       

      When I try to run my test (AccountSignupServiceTest) via a JBoss managed instance, I get this deployment exception:

       

      2013-01-10 21:09:46,421 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "appweb.war"

      2013-01-10 21:09:46,426 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "test.war"

      2013-01-10 21:09:48,575 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."test.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."test.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "test.war"

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

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_33]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_33]

                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_33]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to mount deployment content

                at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:91) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

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

                ... 5 more

      Caused by: java.io.FileNotFoundException: C:\workspace\jboss7.1\standalone\tmp\vfs\temp87fa833bf3f4555b\content-67b466a9c1b989e0\WEB-INF\classes\emailTemplates\emailService\biMonthly\Rewards.html (The system cannot find the path specified)

                at java.io.FileOutputStream.open(Native Method) [rt.jar:1.6.0_33]

                at java.io.FileOutputStream.<init>(FileOutputStream.java:194) [rt.jar:1.6.0_33]

                at java.io.FileOutputStream.<init>(FileOutputStream.java:145) [rt.jar:1.6.0_33]

                at org.jboss.vfs.VFSUtils.unzip(VFSUtils.java:870)

                at org.jboss.vfs.VFS.mountZipExpanded(VFS.java:536)

                at org.jboss.vfs.VFS.mountZipExpanded(VFS.java:567)

                at org.jboss.as.server.deployment.DeploymentMountProvider$Factory$ServerDeploymentRepositoryImpl.mountDeploymentContent(DeploymentMountProvider.java:97) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:87) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                ... 6 more

       

      2013-01-10 21:34:49,239 INFO  [org.jboss.as.server] (management-handler-threads - 1) JBAS015870: Deploy of deployment "test.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"test.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"test.war\".STRUCTURE: Failed to process phase STRUCTURE of deployment \"test.war\""}}

      2013-01-10 21:34:49,239 INFO  [org.jboss.as.controller] (management-handler-threads - 1) JBAS014774: Service status report

      JBAS014777:   Services which failed to start:      service jboss.deployment.unit."test.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."test.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "test.war"

       

       

      2013-01-10 21:34:49,366 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment test.war in 8ms

      2013-01-10 21:34:49,401 ERROR [org.jboss.as.controller.management-operation] (management-handler-threads - 1) JBAS014612: Operation ("undeploy") failed - address: ([("deployment" => "test.war")]): java.util.NoSuchElementException: No child 'runtime-name' exists

                at org.jboss.dmr.ModelValue.requireChild(ModelValue.java:362) [jboss-dmr-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.dmr.ModelNode.require(ModelNode.java:812) [jboss-dmr-1.1.1.Final.jar:1.1.1.Final]

                at org.jboss.as.server.deployment.DeploymentUndeployHandler.execute(DeploymentUndeployHandler.java:58)

                at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:387) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:274) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:202) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.controller.CompositeOperationHandler.execute(CompositeOperationHandler.java:85) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:387) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:274) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:202) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.controller.ModelControllerImpl$DefaultPrepareStepHandler.execute(ModelControllerImpl.java:461) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:387) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:274) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:202) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:121) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.doExecute(ModelControllerClientOperationHandler.java:139) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1.execute(ModelControllerClientOperationHandler.java:108) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.protocol.mgmt.AbstractMessageHandler$2$1.doExecute(AbstractMessageHandler.java:287) [jboss-as-protocol-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:483) [jboss-as-protocol-7.1.0.Final.jar:7.1.0.Final]

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_33]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_33]

                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_33]

                at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:2.0.0.GA]

       

       

      In arquillian.xml, I have:

       

      <engine>

              <property name="deploymentExportPath">target/</property>

      </engine>

       

       

      I opened the archive in the target directory (_DEFAULT___DEFAULT__test.war), and the Rewards.html file is in the right folder inside the war. However, inside ${JBOSS_HOME}/standalone/tmp/vfs/temp87fa833bf3f4555b is nothing.

       

      I'm at a loss why it's failing on the resource files and why the temp directory for the deployment is empty.