与Oracle的WildFly jdbc连接 [英] WildFly jdbc connection with Oracle
问题描述
我尝试创建jdbc连接.
我使用WildFly Application Server
9.0.0.CR1和Oracle 11g.
我将ojdbc14放在文件夹C:\ wildfly-9.0.0.CR1 \ modules \ com \ oracle \ ojdbc14 \ main中创建了module.xml:
I try to create jdbc connection.
I use WildFly Application Server
9.0.0.CR1 and oracle 11g.
I put ojdbc14 and created module.xml in the folder C:\wildfly-9.0.0.CR1\modules\com\oracle\ojdbc14\main:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns=xm lns="urn:jboss:module:1.0"" name="com.oracle.ojdbc14">
<resources>
<resource-root path="ojdbc14.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
并插入到standalone.xml中:
and inserted to the standalone.xml:
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/accounting" pool-name="OracleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:oracle:thin:@cmx-itm-03:1521/COREJAVA</connection-url>
<driver-class>oracle.jdbc.OracleDriver</driver-class>
<driver>oracle</driver>
<security>
<user-name>Java_Learning</user-name>
<password>Qazxsw123</password>
</security>
</datasource>
<drivers>
<driver name="oracle" module="com.oracle.ojdbc14"/>
</drivers>
</datasources>
</subsystem>
因此,从控制台尝试测试连接时出现错误:
So, I got the error when try test connection from console:
Unexpected HTTP response: 500
Request
{
"address" => [
("subsystem" => "datasources"),
("data-source" => "OracleDS")
],
"operation" => "test-connection-in-pool"
}
Response
Internal Server Error
{
"outcome" => "failed",
"failure-description" => "WFLYJCA0040: failed to invoke operation: WFLYJCA0042: failed to match pool. Check JndiName: java:jboss/datasources/accounting",
"rolled-back" => true
}
我用Google搜索了它,并尝试了所有发现的错误,但仍然出现此错误. 请帮帮我.
I googled it and tried all that I found but still have this error. Please, help me.
推荐答案
这种故障有时很难修复,因为它是来自自己服务器的异常.但是,请检查此内容,然后在代码中检查无效的jndiName.
This kind of failures are sometimes difficult to fix, because are exceptions from the own server. However check this, check your invalid jndiName in your code.
https://issues.jboss.org/browse/AS7-2199
这篇关于与Oracle的WildFly jdbc连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!