4 Replies Latest reply on Jul 29, 2014 12:31 PM by Denis Dionne

    oracle ojdbc6 calling procedure that returns a cursor

    Denis Dionne Newbie

      We've been trying to figure this out for a few days now. Everything in our app starts well, but when it tries to get data from our oracle database, we get a ClassCastException in

      oracle.sql.TypeDescriptor from the ojdbc6 jar. This seems to happen because ironjacamar wraps the connection  which the oracle jdbc then takes and tries to cast.

       

      As for our configuration, we've added eclipseLink 2.5 and ojdbc6 to our modules. Some sources that had similar errors mentioned adding a jboss-deployment-structure.xml with the ironjacamar.jdbcadpater and ojdbc6 modules as dependencies, but that didn't seem to change anything.

       

      Any help is appreciated, we might have overlooked something.

       

      Here is the stack trace from the point that the query is invoked:

      java.lang.ClassCastException: org.jboss.jca.adapters.jdbc.jdk7.WrappedConnectionJDK7 cannot be cast to oracle.jdbc.OracleConnection

      at oracle.sql.TypeDescriptor.setPhysicalConnectionOf(TypeDescriptor.java:832) [ojdbc6.jar:11.2.0.3.0]

          at oracle.sql.TypeDescriptor.<init>(TypeDescriptor.java:586) [ojdbc6.jar:11.2.0.3.0]

          at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:224) [ojdbc6.jar:11.2.0.3.0]

          at org.eclipse.persistence.platform.database.oracle.Oracle8Platform.createArray(Oracle8Platform.java:267) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.createArray(DatabasePlatform.java:3030) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.databaseaccess.BindCallCustomParameter.convert(BindCallCustomParameter.java:143) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.databaseaccess.InParameterForCallableStatement.set(InParameterForCallableStatement.java:30) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.setParameterValueInDatabaseCall(DatabasePlatform.java:2401) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.platform.database.oracle.Oracle9Platform.setParameterValueInDatabaseCall(Oracle9Platform.java:513) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.databaseaccess.DatabaseCall.prepareStatement(DatabaseCall.java:797) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:619) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:558) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1995) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:570) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:299) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:694) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:477) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1155) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:899) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1114) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:402) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1202) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2894) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1797) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1779) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1744) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:468) [eclipselink.jar:2.5.0.v20130507-3faac2b]

          at cis.search.product.ProductSearchDAL.readData(ProductSearchDAL.java:374) [CIS_Search_Product_1.0.jar:]

          at cis.search.product.ProductSearchDAL.getRegions(ProductSearchDAL.java:103) [CIS_Search_Product_1.0.jar:]

          at cis.search.services.ProductSearchServiceImpl.retrieveRegions(ProductSearchServiceImpl.java:50) [classes:]