2 Replies Latest reply on Oct 14, 2014 1:42 AM by Dawid Pura

    ShrinkWrap MavenImporter isn't including xml files to WEB-INF/classes directory

    Dawid Pura Newbie

      I have basic enterprise project with arquillian testing (in progress - impediments as always). I want to use AS7.0 container, because WELD is not supporting what i want and OpenEJB isn't working at all.

       

      My jboss profile:

       

      <profile>
        <id>jbossas-managed-7</id>
        <dependencies>
        <dependency>
        <groupId>org.jboss.spec</groupId>
        <artifactId>jboss-javaee-6.0</artifactId>
        <version>1.0.0.Final</version>
        <type>pom</type>
        <scope>provided</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.as</groupId>
        <artifactId>jboss-as-arquillian-container-managed</artifactId>
        <version>7.0.2.Final</version>
        </dependency>
        </dependencies>
        </profile>
      

       

      dependencies for arquillian:

       

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
        <version>${version.junit}</version>
        </dependency>
        <dependency>
        <groupId>org.jboss.arquillian</groupId>
        <artifactId>arquillian-bom</artifactId>
        <version>1.1.5.Final</version>
        <scope>import</scope>
        <type>pom</type>
        </dependency>
        <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <scope>test</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.shrinkwrap.resolver</groupId>
        <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
        <scope>test</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.shrinkwrap.resolver</groupId>
        <artifactId>shrinkwrap-resolver-impl-maven-archive</artifactId>
        </dependency>
        <dependency>
        <groupId>org.jboss.shrinkwrap</groupId>
        <artifactId>shrinkwrap-api</artifactId>
        </dependency>
      

      Resources included:

       

      <resources>
        <resource>
        <directory>src/main/java</directory>
        <includes>
        <include>**/*.xml</include>
        </includes>
        </resource>
       </resources>
      

       

      And, finally, my @Deployment method:

       

      @Deployment
        public static Archive<?> createDeployment() {
            JavaArchive ejb = ShrinkWrap.create(MavenImporter.class)
               .loadPomFromFile("../BlinkLink-ejb/pom.xml", "arquillian-test")
               .importBuildOutput().as(JavaArchive.class);
             WebArchive web = ShrinkWrap.create(MavenImporter.class)
                .loadPomFromFile("pom.xml").importBuildOutput()
                .as(WebArchive.class);
                web.addAsResource(new File("src/main/java/pl/edu/pb/blinklink/webservice/login-handler.xml"));
             EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class)
                .addAsModules(ejb, web).as(EnterpriseArchive.class);
             return ear;
        }
      

       

      I have a handler confing in my src/main/java/... folder, and it won't appear in WEB-INF/classes/... implicates error at jboss deployment:

       

      Caused by: javax.xml.ws.WebServiceException: JBAS015507: Handler chain config file pl/edu/pb/blinklink/webservice/login-handler.xml not found in ResourceRoot [root="/home/dawid/jboss/jboss-as-7.1.1.Final/standalone/deployments/BlinkLink-ear.ear/BlinkLink-web-1.0-SNAPSHOT.war/WEB-INF/classes"]
      

       

      Thanks for help,

      Dawid