0 Replies Latest reply on May 24, 2016 1:42 AM by sandeep acharya

    Class cast expection as "org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast to oracle.jdbc.OracleConnection". in JBOSS 7.2

    sandeep acharya Newbie

      Hi ,

       

      Currently i am trying to deployed my enterprise application on Jboss 7.2.0.Final. The Application deployed successfully.

       

      In one of my transaction we are  using Oracle Types to send the data from application layer oracle 11g Data base .

       

      I am getting Class cast expection as "org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast to oracle.jdbc.OracleConnection".

      I understand that Jboss have its created an WrapperConnection where are the Oracle Type structure Expecting the "oracle.jdbc.OracleConnection".

       

      I tired to below solution.

       

      jboss-deployment structure xml.. used below..,

      =============================

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

      <jboss-deployment-structure>

        <deployment>

        <dependencies>

        <module name="org.jboss.ironjacamar.jdbcadapters" />

        <module name="oracle.jdbc" />

        </dependencies>

        </deployment>

      </jboss-deployment-structure>

       

       

      1. Connection con = dataSource.getConnection();
      2.   if (con.isWrapperFor(OracleConnection.class)) {
      3.     OracleConnection oraCon = con.unwrap(OracleConnection.class);
      4.   } else {
      5.     throw new Exception("Connection is Not Oracle Connection");
      6.   }

       

       

      But still facing the same issue.  So as suggest in one of the forum we need to remove the ojdbc6 jar in the war as its conflict with Jboss Server lib.

       

      When i tired to remove the ojdbc6 jar from  $WAR/META-INF/MANIFEST.MF   Dependencies ..I am getting error class not found. oracle.sql.Datanum .

       

      Please help on this.