3 Replies Latest reply on Jul 29, 2014 3:53 AM by Stefan Biermann

    Problems with Arquillian Jacoco and Arquillian Persistence Extension

    Juan Casta Newbie

      Hi all.

       

      I have a problem and I don`t know how can I excactly solve it.I have written same problem in other question already resolved.

       

      I am trying to use arquillian to run my integracion tests. It works fine with all the tests unless those test that use Arquillian Persistence Extension.

       

      Firstly, I have configured:

       

      • Arquillian 1.1.3.Final.
      • Arquillian Persistence Extension 1.0.0.Alpha7.
      • Glassfish embedded 3.1.2.2.
      • MAVEN JACOCO PLUGIN in my pom.xml.
      • Configure jacoco-maven-plugin.
      • Emma Plugin already configured in Eclipse.

       

      Here is my parent pom and my pom, where I have configured everything:

       

      Pom parent, in which I have set up jacoco plugin.

       

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.6.4.201312101107</version>
        <executions>
        <!--
          Prepares the property pointing to the JaCoCo runtime agent which
          is passed as VM argument when Maven the Surefire plugin is executed.
          -->
        <execution>
        <id>pre-unit-test</id>
        <goals>
        <goal>prepare-agent</goal>
        </goals>
        <configuration>
        <!-- Sets the path to the file which contains the execution data. -->
        <destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
        <!--
          Sets the name of the property containing the settings
          for JaCoCo runtime agent.
          -->
        <propertyName>surefireArgLine</propertyName>
        </configuration>
        </execution>
        <!--
          Ensures that the code coverage report for unit tests is created after
          unit tests have been run.
          -->
        <execution>
        <id>post-unit-test</id>
        <phase>test</phase>
        <goals>
        <goal>report</goal>
        </goals>
        <configuration>
        <!-- Sets the path to the file which contains the execution data. -->
        <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
        <!-- Sets the output directory for the code coverage report. -->
        <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
        </configuration>
        </execution>
        </executions>
        </plugin>
      

      Here my pom, in which I have my profile glassfish embedded configured (I am doing all classes with glassfish embedded all 3.1.2.2):

       

      <version.auth-gneisbase>1.2.16</version.auth-gneisbase>
        <version.org.jboss.jbossas>6.0.0.Final</version.org.jboss.jbossas>
        <version.jacoco>0.6.4.201312101107</version.jacoco>
        <arquillian.jacoco.version>1.0.0.Alpha6</arquillian.jacoco.version>
        <arquillian.persistence.version>1.0.0.Alpha7</arquillian.persistence.version>
      
      <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-persistence-api</artifactId>
        <version>${arquillian.persistence.version}</version>
        <scope>test</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-persistence-core</artifactId>
        <version>${arquillian.persistence.version}</version>
        <scope>test</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-persistence-dbunit</artifactId>
        <version>${arquillian.persistence.version}</version>
        <scope>test</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-persistence-spi</artifactId>
        <version>${arquillian.persistence.version}</version>
        <scope>test</scope>
        </dependency>
      
      ......
      ......
      
      <profile>
        <id>arquillian-glassfish-embedded</id>
        <activation>
        <activeByDefault>true</activeByDefault>
        </activation>
        <dependencies>
        <dependency>
        <groupId>org.jboss.arquillian.container</groupId>
        <artifactId>arquillian-glassfish-embedded-3.1</artifactId>
        <version>1.0.0.CR4</version>
        <scope>test</scope>
        </dependency>
        <dependency>
        <groupId>org.glassfish.main.extras</groupId>
        <artifactId>glassfish-embedded-all</artifactId>
        <version>3.1.2.2</version>
        <scope>test</scope>
        </dependency>
      <!--                                <dependency>
                                              <groupId>com.h2database</groupId>
                                              <artifactId>h2</artifactId>
                                              <version>1.4.177</version>
                                      </dependency>-->
        </dependencies>
      
      .....
      ....
      
        <build>
        <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.12</version>
        <configuration>
        <argLine>${surefireArgLine} -Xms800m -Xmx800m -XX:MaxPermSize=500m</argLine>
        <systemPropertyVariables>
        <arquillian.launch>glassfish-embedded</arquillian.launch>
        <java.util.logging.config.file>
        ${project.build.testOutputDirectory}/glassfish-embedded/logging.properties
        </java.util.logging.config.file>
        <derby.stream.error.file>
        ${project.build.directory}/derby.log
        </derby.stream.error.file>
        </systemPropertyVariables>
        <classpathDependencyExcludes>  
                               <classpathDependencyExcludes>org.apache.openjpa:openjpa-all</classpathDependencyExcludes>
                           </classpathDependencyExcludes>  
        </configuration>
        </plugin>
        </plugins>
        </build>
        </profile>
      
      

       

      I execute mvn test and all my tests unless tests with arquillian persistence extension work. I am actually running with arquillian persistence extension 7.

       

        testCargaCategorias(MyClass): Unable to load Arquillian properties in container. Missing file arquillian.extension.persistence.properties

        testValoresMaximos(MyClass): Unable to load Arquillian properties in container. Missing file arquillian.extension.persistence.properties

        testDataTypesOracle(PruebaArquillianTest): Unable to load Arquillian properties in container. Missing file arquillian.extension.persistence.properties

        testEmptyColumns(PruebaArquillianTest): Unable to load Arquillian properties in container. Missing file arquillian.extension.persistence.properties

       

      This is my arquillian.extension.persistence.properties:

      arquillian.extension.persistence.default.data.seed.strategy=INSERT

      arquillian.extension.persistence.default.transaction.mode=COMMIT

      arquillian.extension.persistence.default.cleanup.phase=AFTER

      arquillian.extension.persistence.dump.directory=d:\\Profiles\\JCASTA~1\\AppData\\Local\\Temp\\

      arquillian.extension.persistence.default.data.source=jdbc/arquillian

      arquillian.extension.persistence.$jacoco.data=[Z@839139

      arquillian.extension.persistence.default.cleanup.strategy=STRICT

      arquillian.extension.persistence.dump.data=false

       

      This is de cause of the problem: arquillian.extension.persistence.$jacoco.data=[Z@839139. This error occurs because there is a bug evolving arquillian persistence extension and jacoco plugin maven. In this url, it is explained:

      Arquillian Persistence does not play along with EclEmma Code Coverage in Eclipse

      [ARQ-1309] Persistence extension does not work with Jacoco extension - JBoss Issue Tracker

       

      Here, is explained that the bug is related with arquillian persistence extension 5 and will be resolved in 7 version. In fact, I have this version already installed.

      Here is the commit:

      https://github.com/arquillian/arquillian-extension-persistence/commit/1bbd207de3ae91176f88dc5b504760df3fd4813f

       

      In the comments of the issue, it is suggested to include also arquillian jacoco extension and jacoco dependency to solve this problem, with this dependencies the bug won`t exist any more.

       

      Now, I include the two dependencies of arquillian jacoco extension:

       

      <!-- DEPENDENCIAS NECESARIAS PARA INTEGRACION ARQUILLIAN JACOCO -->
        <dependency>
                  <groupId>org.jacoco</groupId>
                  <artifactId>org.jacoco.core</artifactId>
                  <version>${version.jacoco}</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
         <groupId>org.jboss.arquillian.extension</groupId>
         <artifactId>arquillian-jacoco</artifactId>
         <version>${arquillian.jacoco.version}</version>
         <scope>test</scope>
        </dependency>
      
      
      

       

      With this result: mvn clean test:

       

        testMetodoPrueba(ArquillianEJBTest): ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.

        testCargaCategorias(CategoriasEJBPETest): ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.

        testGetMovimientosMes(MovimientosEJBPOCTest): ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.

        testValoresMaximos(PruebaArquillianTest): ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.

       

      Typical error when war is not well deployed...

       

      I have already tried with several versiones of jacoco.

       

      Important, for each test I see this error in the trace:

       

      04-jun-2014 14:44:40 org.glassfish.api.ActionReport failure

      GRAVE: Exception while deploying the app [test]

      04-jun-2014 14:44:40 com.sun.enterprise.v3.server.ApplicationLifecycle deploy

      GRAVE: Implementing class

      java.lang.IncompatibleClassChangeError: Implementing class

        at java.lang.ClassLoader.defineClass1(Native Method)

        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)

        at java.lang.ClassLoader.defineClass(ClassLoader.java:615)

        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

        at org.glassfish.hk2.classmodel.reflect.ParsingContext$Builder.build(ParsingContext.java:161)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.getDeployableTypes(ApplicationLifecycle.java:505)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:351)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)

        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)

        at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:129)

        at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:105)

        at org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer.deploy(GlassFishContainer.java:227)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:161)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

        at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

        at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)

        at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

        at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

        at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

        at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:84)

        at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:65)

        at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

        at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)

        at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)

        at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

        at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

        at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

        at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)

        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)

        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)

        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)

        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)

        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)

        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

      classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)

      SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@c92ed6

      04-jun-2014 14:44:40 org.glassfish.deployment.admin.DeployCommand execute

      GRAVE: Exception while deploying the app [test] : Implementing class

      PlainTextActionReporterFAILUREApplication test is not deployed on this target [server]Tests run: 3, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 11.636 sec <<< FAILURE!

       

       

       

      I don´t know what can be exactly the problem.

      1. Arquillian persistence extension 7 doesn`t correct the bug [ARQ-1309] Persistence extension does not work with Jacoco extension - JBoss Issue Tracker.

      2. Arquillian persistence extension doesn`t work with arquillian jacoco (If I comment tests related to arquillian PE everything works).

      3. Glassfish embedded 3.1.2.2 doesn`t play with arquillian jacoco. Yesterday this new fix has been published: Replace glassfish-embedded-all with spec libraries by aslakknutsen · Pull Request #1 · conventions/archetype · GitHub.

      Is really a problem with glassfish embedded?

       

      Please, any help would be considerated. I have been struggling with this a lot of time.

       

      Related posts:

       

      https://issues.jboss.org/browse/ARQ-1309

      [ARQ-1309] Improved handling of properties. Ignores and reports those wh... · 1bbd207 · arquillian/arquillian-extension…

      Re: Re: Arquillian Persistence does not play along with EclEmma Code Coverage in Eclipse

       

      Regards.

        • 1. Re: Problems with Arquillian Jacoco and Arquillian Persistence Extension
          Juan Casta Newbie

          java.lang.IncompatibleClassChangeError when adding arquillian-jacoco to project · Issue #8 · arquillian/arquillian-exten…

          Replace glassfish-embedded-all with spec libraries by aslakknutsen · Pull Request #1 · conventions/archetype · GitHub

           

          Following this article, because maybe the problem is with glassfish-embedded, I configure maven-surefire-plugin to exclude clases asm:

           

          <build>

            <plugins>

            <plugin>

            <groupId>org.apache.maven.plugins</groupId>

            <artifactId>maven-surefire-plugin</artifactId>

            <version>2.12</version>

            <configuration>

            <argLine>${surefireArgLine} -Xms800m -Xmx800m -XX:MaxPermSize=500m</argLine>

            <systemPropertyVariables>

            <arquillian.launch>glassfish-embedded</arquillian.launch>

            <java.util.logging.config.file>

            ${project.build.testOutputDirectory}/glassfish-embedded/logging.properties

            </java.util.logging.config.file>

            <derby.stream.error.file>

            ${project.build.directory}/derby.log

            </derby.stream.error.file>

            </systemPropertyVariables>

            <classpathDependencyExcludes> 

                                   <classpathDependencyExcludes>org.apache.openjpa:openjpa-all</classpathDependencyExcludes>

                                   <classpathDependencyExcludes>org.ow2.asm:asm-all</classpathDependencyExcludes>                       

                               </classpathDependencyExcludes> 

            </configuration>

            </plugin>

            </plugins>

            </build>

           

          And I get this error:

           

          -------------------------------------------------------------------------------

          Test set: com.gneis.ebkextracto.ejb.ArquillianEJBTest

          -------------------------------------------------------------------------------

          Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.769 sec <<< FAILURE!

          com.gneis.ebkextracto.ejb.ArquillianEJBTest  Time elapsed: 4.767 sec  <<< ERROR!

          org.jboss.shrinkwrap.api.exporter.ArchiveExportException: Failed to write asset to output: /WEB-INF/lib/test.jar

            at org.jboss.shrinkwrap.impl.base.exporter.AbstractOnDemandInputStream.read(AbstractOnDemandInputStream.java:132)

            at java.io.InputStream.read(InputStream.java:151)

            at java.io.InputStream.read(InputStream.java:82)

            at org.jboss.shrinkwrap.impl.base.io.IOUtil.copy(IOUtil.java:138)

            at org.jboss.shrinkwrap.impl.base.exporter.AbstractStreamExporterImpl.exportTo(AbstractStreamExporterImpl.java:120)

            at org.jboss.shrinkwrap.impl.base.exporter.AbstractStreamExporterImpl.exportTo(AbstractStreamExporterImpl.java:148)

            at org.jboss.arquillian.container.impl.client.deployment.ArchiveDeploymentExporter.callback(ArchiveDeploymentExporter.java:82)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

            at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

            at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

            at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

            at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

            at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

            at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:155)

            at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)

            at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)

            at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

            at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

            at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

            at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

            at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

            at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

            at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

            at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

            at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

            at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

            at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

            at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

            at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)

            at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)

            at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)

            at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)

            at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

            at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

            at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

            at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

            at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

            at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

            at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

            at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

            at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

            at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:84)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

            at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

            at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:65)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

            at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

            at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

            at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

            at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)

            at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)

            at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

            at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

            at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

            at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

            at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

            at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)

            at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)

            at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)

            at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)

            at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)

            at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)

            at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

          Caused by: org.jboss.shrinkwrap.api.exporter.ArchiveExportException: Failed to write asset to output: /com/gneis/ebkextracto/ejb/ArquillianEJB.class

            at org.jboss.shrinkwrap.impl.base.exporter.AbstractOnDemandInputStream.read(AbstractOnDemandInputStream.java:132)

            at org.jboss.shrinkwrap.impl.base.exporter.AbstractOnDemandInputStream.read(AbstractOnDemandInputStream.java:158)

            at org.jboss.shrinkwrap.impl.base.exporter.AbstractOnDemandInputStream.read(AbstractOnDemandInputStream.java:158)

            at org.jboss.shrinkwrap.impl.base.exporter.AbstractOnDemandInputStream.read(AbstractOnDemandInputStream.java:158)

            at java.io.InputStream.read(InputStream.java:160)

            at java.io.InputStream.read(InputStream.java:82)

            at org.jboss.shrinkwrap.impl.base.io.IOUtil.copy(IOUtil.java:159)

            at org.jboss.shrinkwrap.impl.base.exporter.AbstractOnDemandInputStream.doCopy(AbstractOnDemandInputStream.java:170)

            at org.jboss.shrinkwrap.impl.base.exporter.AbstractOnDemandInputStream.read(AbstractOnDemandInputStream.java:130)

            ... 109 more

          Caused by: java.lang.IncompatibleClassChangeError: class org.jacoco.core.internal.flow.ClassProbesVisitor has interface org.objectweb.asm.ClassVisitor as super class

            at java.lang.ClassLoader.defineClass1(Native Method)

            at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)

            at java.lang.ClassLoader.defineClass(ClassLoader.java:615)

            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

            at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

            at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

            at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

            at java.security.AccessController.doPrivileged(Native Method)

            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

            at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

            at org.jboss.arquillian.extension.jacoco.client.InstrumenterAsset.openStream(InstrumenterAsset.java:54)

            at org.jboss.shrinkwrap.impl.base.exporter.AbstractOnDemandInputStream.read(AbstractOnDemandInputStream.java:129)

            ... 117 more

          • 2. Re: Problems with Arquillian Jacoco and Arquillian Persistence Extension
            Bartosz Majsak Master

            Re-opend JIRA, will investigate further.

             

            Cheers,

            Bartosz

            • 3. Re: Problems with Arquillian Jacoco and Arquillian Persistence Extension
              Stefan Biermann Newbie

              Hi,

              i have the same problem and found a workarround. It is not the best solution but it works fine and it also enables code coverage with client tests.

               

              I have removed the Arquillian Jacoco Extension and using the dependency plugin from maven top unpack the jacoco agent in the target folder. Following is my pom.xml with the jacoco and dependency plugin setup:

               

                        ... 
                        <plugin>
                              <groupId>org.jacoco</groupId>
                              <artifactId>jacoco-maven-plugin</artifactId>
                              <version>${jacoco.version}</version>
                              <configuration>
                                  <dumpOnExit>true</dumpOnExit>
                                  <excludes>
                                      <exclude>org.jboss.arquillian.*</exclude>
                                      <exclude>my.example.test.*</exclude>
                                  </excludes>
                              </configuration>
                              <executions>
                                  <execution>
                                      <goals>
                                          <goal>prepare-agent</goal>
                                      </goals>
                                  </execution>
                                  <execution>
                                      <id>report</id>
                                      <phase>prepare-package</phase>
                                      <goals>
                                          <goal>report</goal>
                                      </goals>
                                  </execution>
                              </executions>
                          </plugin>
                          <plugin>
                              <artifactId>maven-dependency-plugin</artifactId>
                              <executions>
                                  <execution>
                                      <id>unpack</id>
                                      <phase>process-test-classes</phase>
                                      <goals>
                                          <goal>unpack</goal>
                                      </goals>
                                      <configuration>
                                          <artifactItems>
                                              <artifactItem>
                                                  <groupId>org.wildfly</groupId>
                                                  <artifactId>wildfly-dist</artifactId>
                                                  <version>${wildfly.version}</version>
                                                  <type>zip</type>
                                                  <overWrite>false</overWrite>
                                                  <outputDirectory>target</outputDirectory>
                                              </artifactItem>
                                              <artifactItem>
                                                  <groupId>org.jacoco</groupId>
                                                  <artifactId>org.jacoco.agent</artifactId>
                                                  <version>${jacoco.version}</version>
                                                  <type>jar</type>
                                                  <overWrite>false</overWrite>
                                                  <outputDirectory>target/jacoco-agent</outputDirectory>
                                              </artifactItem>
                                          </artifactItems>
                                      </configuration>
                                  </execution>
                              </executions>
                          </plugin>
              ...
              
              

               

              With removing the Arquillian Jacoco Extension no code coverage is measured, so i have to add it manually to the arquillian.xml. Following shows my arquillian.xml:

               

              <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-as-managed"
                          default="true">
                      <configuration>
                          <property name="javaVmArguments">-Xmx1024m -XX:MaxPermSize=512m -javaagent:target/jacoco-agent/jacocoagent.jar=destfile=target/jacoco.exec,excludes=org.jboss.arquillian.*:my.example.test.*,dumponexit=true</property>
                          <property name="serverConfig">standalone-full.xml</property>
                      </configuration>
                  </container>
                  <extension qualifier="webdriver">
                      <property name="browser">${browser}</property>
                  </extension>
                  <extension qualifier="persistence-dbunit">
                      <property name="datatypeFactory">org.dbunit.ext.h2.H2DataTypeFactory</property>
                  </extension>
                  <extension qualifier="persistence">
                      <property name="defaultDataSource">java:jboss/datasources/ExampleDS</property>
                  </extension>
              </arquillian>
              
              

               

              The important point in the arquillian.xml is the excludes=org.jboss.arquillian.* in the javaVmArguments property, With this, no arquillian.extension.persistence.$jacoco.data=[Z@839139 will be written to the arquillian.extension.persistence.properties. Now my tests working fine and i have code coverage also in client tests with Arquillian Drone.

               

              Regards

              Stefan