5 Replies Latest reply on Nov 2, 2017 6:20 PM by Steve Ferguson

    Arquillian Persistence extension with JBOSS, and ORACLE with CLOBs

    Steve Ferguson Newbie

      Hi there,

       

      I am currently trying to setup a project with arquillian persistence extension. I need to run with JBOSS EAP 6.4.0 and Oracle 11G. This configuration has given me problem after problem. I think I may be down to the last such problem, but I have not been able to determine a fix as yet. All works well unless I have test data loading for tables which contain Clob data. At the point it tries to load the test data I get the Exception :

       

      Caused by: java.lang.ClassCastException: org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast to oracle.jdbc.OracleConnection

      at oracle.sql.CLOB.createTemporary(CLOB.java:979)

      at oracle.sql.CLOB.createTemporary(CLOB.java:939)

      at org.dbunit.ext.oracle.OracleClobDataType.getClob(OracleClobDataType.java:76)

      ...

       

      It seems the dbunit code is not properly "unwrapping" the JBOSS provided connection prior to passing it into the Oracle driver to create the Clob. Is there any way to work around this? I have tried various different ways of specifying the Oracle driver, as a module in jboss, referenced in jboss-deployment-structure.xml, along with <module name="org.jboss.ironjacamar.jdbcadapters" slot="main"/> as I found in other posts, and nothing works.

       

      Any help would be greatly appreciated.

       

      Versions :

              <dependency>

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

                  <artifactId>arquillian-bom</artifactId>

                  <version>1.1.13.Final</version>

                  <scope>import</scope>

                  <type>pom</type>

              </dependency>

       

      <dependency>

         <groupId>org.arquillian.ape</groupId>

         <artifactId>arquillian-ape-sql-container-dbunit</artifactId>

         <version>2.0.0-alpha.4</version>

         <scope>test</scope>

      </dependency>

       

             <dependency>

                 <groupId>org.jboss.as</groupId>

                 <artifactId>jboss-as-arquillian-container-managed</artifactId>

                 <version>7.2.0.Final</version>

                 <scope>test</scope>

             </dependency>