java.lang.ClassCastException: org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 不能被转换 [英] java.lang.ClassCastException: org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast

查看:21
本文介绍了java.lang.ClassCastException: org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 不能被转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应用程序版本:JBoss 7.0.0、Oracle 11g (ojdbc6.jar) 和 JDK 6 版本

当我尝试使用 CLOB.createTemporary 函数插入 CLOB 数据类型的值时遇到问题,得到以下异常.

I have a problem when I am trying to insert the value for CLOB Data type using CLOB.createTemporary function, getting the below exception.

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

在多个论坛搜索后,没有找到任何解决方案.https://forums.oracle.com/forums/thread.jspa?threadID=279238

After searching in multiple forums, did not find any solution. https://forums.oracle.com/forums/thread.jspa?threadID=279238

部署 WAR 文件和配置 JBoss oracle 驱动程序池配置所需的基本步骤已完成.但是,仍然无法解决这个问题.

Basic steps required to deploy a WAR file and configuring the JBoss oracle driver pool configuration is done. But, still not able to get through this issue.

请提供解决此问题的解决方案.

Please provide solution to fix this problem.

推荐答案

我已经用下面的方法解决了我的问题.

I have solved my problem with the below approach.

总结: 类加载器不应从服务器库/模块和 Web 存档(WAR 文件)加载 Oracle 驱动程序.仅将 oracle 驱动程序保留在服务器库中(JBoss 7 版本).

Summary: Class loader should not load the Oracle driver from server lib/modules and in web archive (WAR file). Keep the oracle driver only in server lib (JBoss 7 ver).

JBoss 7:

  • 创建了一个新的 JBoss 部署描述符文件(jboss-deployment-structure.xml)

  • Created a new JBoss deployment descriptor file(jboss-deployment-structure.xml)

  1. 更新了jboss部署结构文件中的(ironjacamar-jdbc-1.0.3.Final.jar)iron模块
  2. 在 JBoss 7 结构中创建 ojdbc6.jar 作为模块更新了jboss部署结构文件中的objbc模块
  3. 示例:

<jboss-deployment-structure> 
    <deployment>
        <dependencies>
            <module name="org.jboss.ironjacamar.jdbcadapters" slot="main"/>
            <module name="com.oracle.ojdbc6" slot="main"/>
        </dependencies>
    </deployment> 
</jboss-deployment-structure>

网络模块:- 从网络存档(WAR 文件)中删除了 ojdbc6.jar 文件

Web module: - Removed the ojdbc6.jar file from the web archive(WAR file)

如果您在解决过程中发现任何问题,请告诉我.

If you find any issue in solving, please let me know.

这篇关于java.lang.ClassCastException: org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 不能被转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆