0 Replies Latest reply on May 28, 2015 5:20 AM by Nikolai Kovalenko

    wildfly arquillian error active-op failed null: java.io.IOException: Failed to write asset to output

    Nikolai Kovalenko Newbie

      Good day. I have jaxrs rest service which works with jpa/persistence. I need to write test for class with service with arquillian. I'm using remote wildfly 8.2.0.Final for in container testing. When createDeployment method executed deployment hangs, nothing happens after. I changed log level in wildfly standalone profile to ALL and found in server.log next exception:

       

          2015-05-28 10:46:11,228 DEBUG [org.jboss.as.protocol] (Remoting "iba001a9272d0d2:MANAGEMENT" task-7) active-op (1429492412) failed null: java.io.IOException: Failed to write asset to output: /WEB-INF/classes/by/iba/gomel/domain/orgunit/package-info.class

          at org.jboss.as.protocol.mgmt.AbstractManagementRequest.handleFailed(AbstractManagementRequest.java:63) [wildfly-protocol-8.2.0.Final.jar:8.2.0.Final]

          at org.jboss.as.protocol.mgmt.AbstractMessageHandler$ActiveRequest.handleFailed(AbstractMessageHandler.java:471) [wildfly-protocol-8.2.0.Final.jar:8.2.0.Final]

          at org.jboss.as.protocol.mgmt.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:112) [wildfly-protocol-8.2.0.Final.jar:8.2.0.Final]

          at org.jboss.as.protocol.mgmt.ManagementChannelReceiver$1.handleMessage(ManagementChannelReceiver.java:56) [wildfly-protocol-8.2.0.Final.jar:8.2.0.Final]

          at org.jboss.as.protocol.mgmt.ManagementChannelReceiver.handleMessage(ManagementChannelReceiver.java:84) [wildfly-protocol-8.2.0.Final.jar:8.2.0.Final]

          at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:463) [jboss-remoting-4.0.6.Final.jar:4.0.6.Final]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_76]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_76]

          at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_76]

       

      After that exception follows next cyclical thing many times (not two times):

       

          2015-05-28 10:46:12,785 TRACE [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) Scan complete

          2015-05-28 10:46:17,787 TRACE [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) Scanning directory D:\MKavalenka\wildfly-8.2.0.Final\standalone\deployments for deployment content changes

          2015-05-28 10:46:17,787 TRACE [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) Executing "read-children-resources" []

          2015-05-28 10:46:17,789 TRACE [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) Prepared response is {

              "outcome" => undefined,

              "result" => {}

          }

          2015-05-28 10:46:17,790 TRACE [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) Scan complete

          2015-05-28 10:46:22,790 TRACE [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) Scanning directory D:\MKavalenka\wildfly-8.2.0.Final\standalone\deployments for deployment content changes

          2015-05-28 10:46:22,790 TRACE [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) Executing "read-children-resources" []

          2015-05-28 10:46:22,792 TRACE [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) Prepared response is {

              "outcome" => undefined,

              "result" => {}

          }

       

      Here is my createDeployment method:

       

          @Deployment(testable = true)

          public static Archive<?> createDeployment() {

              final WebArchive war = ShrinkWrap.create(WebArchive.class, "dataUploadTest.war")

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

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

                      .addAsWebInfResource("wildfly-ds.xml").addAsResource("functionalId.properties")

                      .addAsResource("logback-test.xml", "logback.xml")

                      .addAsResource("xml/organizationalUnit.xml")

                      .addAsResource("xsd/organizationalUnit.xsd")

                      .addPackage("by.iba.gomel.domain.orgunit");

              // .addAsLibraries(

              // Maven.resolver().resolve("org.aspectj:aspectjrt:1.8.5").withTransitivity()

              // .asFile());

              DataUploadRestServiceIT.LOGGER.info("generated .war file - " + war.toString(true) + "\n");

              return war;

          }

       

      Here is my wildfly-ds.xml

       

          <?xml version="1.0" encoding="UTF-8"?>

          <!DOCTYPE project>

          <datasources xmlns="http://www.jboss.org/ironjacamar/schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

            xsi:schemaLocation="

                  http://www.jboss.org/ironjacamar/schema

                  http://docs.jboss.org/ironjacamar/schema/datasources_1_1.xsd">

            <datasource enabled="true" jndi-name="jdbc/arquillian" pool-name="ArquillianEmbeddedH2Pool">

              <connection-url>jdbc:h2:mem:arquillian;INIT=CREATE SCHEMA IF NOT EXISTS

                JBPMDB;DB_CLOSE_DELAY=-1;MODE=PostgreSQL</connection-url>

              <driver>h2</driver>

            </datasource>

          </datasources>

       

      Here is arquillian.xml:

       

          <?xml version="1.0" encoding="UTF-8"?>

          <arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

            xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

            <defaultProtocol type="Servlet 3.0" />

            <container qualifier="wildfly" default="true">

              <configuration>

                <property name="managementAddress">127.0.0.1</property>

                <property name="managementPort">9990</property>

                <property name="username">adminUser</property>

                <property name="password">adminPassword</property>

              </configuration>

            </container>

          </arquillian>

       

      Dependencies from pom.xml:

       

          <dependency>

                <groupId>org.jboss.resteasy</groupId>

                <artifactId>resteasy-jaxrs</artifactId>

                <scope>provided</scope>

              </dependency>

              <dependency>

                <groupId>org.hibernate.javax.persistence</groupId>

                <artifactId>hibernate-jpa-2.0-api</artifactId>

                <scope>provided</scope>

              </dependency>

              <dependency>

                <groupId>org.jboss.spec.javax.servlet</groupId>

                <artifactId>jboss-servlet-api_3.1_spec</artifactId>

              </dependency>

              <dependency>

                <groupId>javax.transaction</groupId>

                <artifactId>jta</artifactId>

                <scope>provided</scope>

              </dependency>

              <!-- dependencies for arquillian testing -->

              <dependency>

                <groupId>org.jboss.arquillian.junit</groupId>

                <artifactId>arquillian-junit-container</artifactId>

                <scope>test</scope>

              </dependency>

              <dependency>

                <groupId>org.wildfly</groupId>

                <artifactId>wildfly-arquillian-container-remote</artifactId>

                <version>8.1.0.Final</version>

                <scope>test</scope>

              </dependency>

              <dependency>

                <groupId>org.jboss.resteasy</groupId>

                <artifactId>resteasy-client</artifactId>

                <scope>test</scope>

              </dependency>

              <dependency>

                <groupId>org.jboss.arquillian.protocol</groupId>

                <artifactId>arquillian-protocol-servlet</artifactId>

                <scope>test</scope>

              </dependency>

              <dependency>

                <groupId>org.jboss.remoting</groupId>

                <artifactId>jboss-remoting</artifactId>

                <version>4.0.6.Final</version>

              </dependency>

              <dependency>

                <groupId>org.jboss.shrinkwrap.resolver</groupId>

                <artifactId>shrinkwrap-resolver-impl-maven</artifactId>

                <scope>test</scope>

              </dependency>

       

      What is that exception and how to solve it? May be some body knows...