ClassCastException:org.jboss.jca.adapters.jdbc.jdk6.WrappedPreparedStatementJDK6无法转换为OraclePreparedStatement [英] ClassCastException: org.jboss.jca.adapters.jdbc.jdk6.WrappedPreparedStatementJDK6 cannot be cast to OraclePreparedStatement
问题描述
我正在将应用程序从Oracle Application Server迁移到JBoss EAP 6.1.我的大部分工作都在工作,但是我遇到了一个我无法弄清的错误:
I'm working to migrate an application from Oracle Application Server to JBoss EAP 6.1. I have most things working but I am getting one error that I haven't been able to figure out:
13:27:29,743 ERROR [com.myproj.db.dao.myDao] (Thread-164) Get Prepared Statement:
java.lang.ClassCastException:
org.jboss.jca.adapters.jdbc.jdk6.WrappedPreparedStatementJDK6 cannot be cast
to oracle.jdbc.internal.OraclePreparedStatement
我在JBoss中将Oracle设置为模块,用于使用ojdbc6.jar
进行连接池(并且适用于应用程序的其他部分),但是对于使用OraclePreparedStatement
的应用程序的一部分,它将获得错误.
I have Oracle set up as a module in JBoss for connection pooling using ojdbc6.jar
(and it works for other parts of the application), but for the one part of the application that uses an OraclePreparedStatement
, it gets the error.
我确实确定WAR文件中没有ojdbc6.jar
文件. JBoss中唯一的一个似乎在模块内部.
I did make certain that there is no ojdbc6.jar
file in the WAR file. The only one in JBoss seems to be inside of the module.
我确实尝试将OraclePreparedStatement
类更改为oracle.jdbc.OraclePreparedStatement
,但是结果是相同的.
I did try changing the OraclePreparedStatement
class to oracle.jdbc.OraclePreparedStatement
, but the results are the same.
我确实尝试在TRACE上运行以进行日志记录,以查看从何处加载类. OraclePreparedStatement
是从模块加载的,但以下行除外:
I did try running with TRACE on for logging to see where classes were loading from. OraclePreparedStatement
was loaded from the module with the exception of this line:
4:31:40,583 TRACE [org.jboss.modules] (Thread-84) Finding class
oracle.jdbc.OraclePreparedStatement from Module "deployment.myProj.war:main" from
Service Module Loader
这是日志摘录的链接-基本上只是与OraclePreparedStatement
有关的行.
Here's a link to an excerpt of the log - basically just the lines related to OraclePreparedStatement
.
我已经确认WAR文件中没有ojdbc6.jar
(或任何与Oracle相关的jars),并且WAR文件中也没有OraclePreparedStatement
类.
I have confirmed that there is no ojdbc6.jar
(or any Oracle related jars) in the WAR file, and there is no OraclePreparedStatement
class inside of the WAR file either.
我确实在我的JBoss部署结构xml文件中将模块列为依赖项.
I do have the module listed as a dependency in my JBoss deployment structure xml file.
有人有什么主意吗?
推荐答案
通过查看javadoc,我猜想org.jboss.jca.adapters.jdbc.jdk6.WrappedPreparedStatementJDK6
正在包装底层的Oracle JDBC驱动程序.
From looking at the javadoc I would guess that org.jboss.jca.adapters.jdbc.jdk6.WrappedPreparedStatementJDK6
is wrapping the underlying Oracle JDBC driver.
org.jboss.jca.adapters.jdbc.jdk6.WrappedPreparedStatementJDK6
具有获取基础语句的方法.也许您应该尝试如下操作:
org.jboss.jca.adapters.jdbc.jdk6.WrappedPreparedStatementJDK6
has a method to get the underlying statement. Perhaps you should try something like the following:
WrappedPreparedStatementJDK6 statement = ...
OraclePreparedStatement oracleStatement = (OraclePreparedStatement)statement.getUnderlyingStatement();
这篇关于ClassCastException:org.jboss.jca.adapters.jdbc.jdk6.WrappedPreparedStatementJDK6无法转换为OraclePreparedStatement的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!