5 Replies Latest reply on Nov 25, 2013 8:05 AM by kelly goedert

    does arquillian persistence work with jboss 6.x?

    kelly goedert Apprentice

      Hi,

       

      I have used arquillian and the persistence extension in projects using jboss 7.1.1 and it works great. Now, would like to set it up on a project using jboss 6.x. Is it supported? When I run the test, the war is deployed correctly but I get a unable to commit the transaction exception. Like this:

       

      java.lang.RuntimeException: Unable to commit the transaction.
        at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.commitTransaction(JtaTransactionProvider.java:79)
        at org.jboss.arquillian.transaction.impl.lifecycle.TransactionHandler.endTransactionAfterTest(TransactionHandler.java:111)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:622)
        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
        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.testenricher.cdi.CreationalContextDestroyer.destory(CreationalContextDestroyer.java:44)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:622)
        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
        at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:622)
        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
        at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:622)
        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
        at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:622)
        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
        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.after(EventTestRunnerAdaptor.java:103)
        at org.jboss.arquillian.junit.Arquillian$5$1.evaluate(Arquillian.java:245)
        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$5.evaluate(Arquillian.java:240)
        at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
        at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)
        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:236)
        at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
        at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65)
        at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:160)
        at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:126)
        at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:90)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
        at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
        at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
        at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)
        at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)
        at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
        at java.lang.Thread.run(Thread.java:701)
      Caused by: java.lang.NullPointerException
        at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.isTransactionMarkedToRollback(JtaTransactionProvider.java:137)
        at org.jboss.arquillian.transaction.jta.provider.JtaTransactionProvider.commitTransaction(JtaTransactionProvider.java:73)
        ... 93 more
      

       

      My arquillian xml is as follows:

       

      <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">
        <container qualifier="JBOSS_AS_REMOTE_6.X" default="true">
        </container>
        <extension qualifier="webdriver">
        <property name="browser">chrome</property>
        </extension>
        <engine>
        <property name="deploymentExportPath">target</property>
        </engine>
      
        <extension qualifier="persistence">
            <property name="defaultDataSeedStrategy">INSERT</property>
        </extension>
      
        <extension qualifier="persistence-dbunit">    
          <property name="qualifiedTableNames">false</property>
          <property name="schema">mtmtest</property>
          <!-- <property name="skipOracleRecycleBinTables">true</property>
           <property name="datatypeFactory">org.dbunit.ext.oracle.OracleDataTypeFactory</property> --> 
        </extension>
      
         <extension qualifier="persistence-script">
          <property name="sqlStatementDelimiter">;</property>
        </extension>
      
        <testResources>
        <testResource>
        <directory>src/test/resources</directory>
        </testResource>
        <testResource>
        <directory>src/main/webapp</directory>
        </testResource>
        </testResources>
      </arquillian>
      
      

       

      And the pom parts related to jboss and arquillian

       

       

        <properties>
        <project.build.sourceEncoding>ISO8859-1</project.build.sourceEncoding>
        <jboss-javaee6-spec.version>1.0.0.Final</jboss-javaee6-spec.version>
        <jndi>${provider.url}</jndi>
        <seam.version>3.1.0.Final</seam.version>
        <version.junit>4.11</version.junit>
        <version.arquillian_core>1.0.1.Final</version.arquillian_core>
        <version.shrinkwrap.resolvers>2.1.0-alpha-1</version.shrinkwrap.resolvers>
        <version.jboss.bom>1.0.7.Final</version.jboss.bom>
        <version.source>1.6</version.source>
        </properties>
      
      
        <profiles>
        <profile>
        <id>jbossas-remote-6</id>
        <dependencies>
        <dependency>
        <groupId>org.jboss.jbossas</groupId>
        <artifactId>jboss-as-client</artifactId>
        <version>6.1.0.Final</version>
        </dependency>
        </dependencies>
        <build>
        <plugins>
        <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <executions>
        <execution>
        <id>surefire-itest</id>
        <phase>test</phase>
        <goals>
        <goal>test</goal>
        </goals>
        <configuration>
        <excludes>
        <exclude>none</exclude>
        </excludes>
        </configuration>
        </execution>
        </executions>
        </plugin>
        </plugins>
        <testResources>
        <testResource>
        <directory>src/test/resources</directory>
        </testResource>
        <testResource>
        <directory>src/test/resources-jbossas-remote</directory>
        </testResource>
        </testResources>
        </build>
        </profile>
        <profile>
        <id>arquillian</id>
        <build>
        <testResources>
        <testResource>
        <directory>src/test/resources</directory>
        </testResource>
        </testResources>
        <plugins>
        <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.16</version>
        <configuration>
        <systemPropertyVariables>
        <arquillian.launch>JBOSS_AS_REMOTE_6.X</arquillian.launch>
        </systemPropertyVariables>
        </configuration>
        </plugin>
      
        </plugins>
        </build>
        </profile>
      ...
        </profiles>
      
      
        <dependencyManagement>
        <dependencies>
        <dependency>
        <groupId>org.jboss.shrinkwrap.resolver</groupId>
        <artifactId>shrinkwrap-resolver-bom</artifactId>
        <version>${version.shrinkwrap.resolvers}</version>
        <scope>import</scope>
        <type>pom</type>
        </dependency>
        <dependency>
        <groupId>org.jboss.arquillian</groupId>
        <artifactId>arquillian-bom</artifactId>
        <version>${version.arquillian_core}</version>
        <type>pom</type>
        <scope>import</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-drone-bom</artifactId>
        <version>1.2.0.CR1</version>
        <type>pom</type>
        <scope>import</scope>
        </dependency>
        <dependency>
              <groupId>org.jboss.spec</groupId>
              <artifactId>jboss-javaee-6.0</artifactId>
              <version>3.0.2.Final</version>
              <type>pom</type>
              <scope>import</scope>
      
      
        </dependencyManagement>
      
      
        <dependencies>
      
        <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <scope>provided</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.spec.javax.annotation</groupId>
        <artifactId>jboss-annotations-api_1.1_spec</artifactId>
        <scope>provided</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.spec.javax.servlet</groupId>
        <artifactId>jboss-servlet-api_3.0_spec</artifactId>
        <scope>provided</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.spec.javax.faces</groupId>
        <artifactId>jboss-jsf-api_2.0_spec</artifactId>
        <scope>provided</scope>
        </dependency>
        <dependency>
      
        <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.2</version>
        <scope>test</scope>
        </dependency>
        <dependency>
      
      
        <!-- Dependencias dos testes -->
        <dependency>
         <groupId>org.jboss.arquillian.container</groupId>
         <artifactId>arquillian-jbossas-remote-6</artifactId>
         <version>1.0.0.CR3</version>
         <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.arquillian.protocol</groupId>
        <artifactId>arquillian-protocol-servlet</artifactId>
        <scope>test</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <scope>test</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-drone-impl</artifactId>
        <scope>test</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-jacoco</artifactId>
        <version>1.0.0.Alpha5</version>
        <scope>test</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-persistence-impl</artifactId>
        <version>1.0.0.Alpha6</version>
        <scope>test</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.shrinkwrap.resolver</groupId>
        <artifactId>shrinkwrap-resolver-depchain</artifactId>
        <scope>test</scope>
        <type>pom</type>
        </dependency>
        <dependency>
                  <groupId>org.jboss.jbossas</groupId>
                  <artifactId>jboss-as-client</artifactId>
                  <version>6.1.0.Final</version>
                  <type>pom</type>
                  <scope>test</scope>
              </dependency>
        </dependencies>
      ...
      </project>