我正在尝试在jboss 6中配置数据源。
以下是我所做的配置,当我检查管理控制台可以看到enabled = true时,但是当我启动并运行时,我可以看到以下错误
我安装了oracle ojdbc6.jar,它在部署文件夹中并处于已部署状态,我正在使用oracle 11.2服务器并使用JdK 1.7。
我尝试通过其他论坛但没有找到任何答案....对此有任何帮助,我是否正确配置,为什么我无法获取元数据
ERROR:
18:18:21,150 WARN [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016027: Local XARecoveryModule.xaRecovery got XA exception XAException.XAER_RMERR: javax.transaction.xa.XAException
at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:709)
错误2
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleTypes from [Module "deployment.test.ear.atg_bootstrap_ejb.jar:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_40]
at java.lang.Class.forName(Class.java:190) [rt.jar:1.7.0_40]
at atg.adapter.gsa.OracleStoredProcedureHelper.initialize(OracleStoredProcedureHelper.java:133) [_DAS_slib_sclasses.jar:]
DataSource配置。
<datasources>
<drivers>
<driver module="com.h2database.h2" name="h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
<xa-datasource enabled="true" jndi-name="java:/prodDs" pool-name="prodDs" use-java-context="true">
<xa-datasource-property name="URL">jdbc:oracle:thin:@XXXXXX:1521:test</xa-datasource-property>
<xa-datasource-property name="User">XXX</xa-datasource-property>
<xa-datasource-property name="Password">XXXX</xa-datasource-property>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<driver>ojdbc6.jar</driver>
<security>
<user-name>XXX</user-name>
<password>XXXX</password>
</security>
<xa-pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>100</max-pool-size>
<is-same-rm-override>false</is-same-rm-override>
</xa-pool>
<timeout>
<blocking-timeout-millis>5000</blocking-timeout-millis>
<idle-timeout-minutes>15</idle-timeout-minutes>
</timeout>
<validation>
<exception-sorter class-name="org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter"/>
</validation>
<!-- To avoid deadlocks you need set this -->
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
</xa-datasource>
答案 0 :(得分:1)
更改驱动程序标记,如下所示
<drivers>
<driver name="ojdbc6.jar" module="com.oracle">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>