Jboss Oracle JDBC 连接失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29566014/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Jboss Oracle JDBC connection failed
提问by Euphe
Jboss EAP 6.3, Oracle 11g Express. I have this oracle datasource in standalone:
Jboss EAP 6.3,Oracle 11g Express。我有这个独立的 oracle 数据源:
<datasource jta="true" jndi-name="java:/OracleDS" pool-name="OracleDS">
<connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
<driver>oracleDriver</driver>
<security>
<user-name>Boris</user-name>
<password>password</password>
</security>
</datasource>
<drivers>
<driver name="oracleDriver" module="com.oracle">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
The Oracle database is running, I can connect to it using sqlplus:
Oracle 数据库正在运行,我可以使用 sqlplus 连接到它:
SQL> connect
Enter user-name: Boris
Enter password:
Connected.
The datasource shows up in the Jboss admin panel. I run a test connection, but it responds with:
数据源显示在 Jboss 管理面板中。我运行了一个测试连接,但它的响应是:
Unexpected HTTP response: 500
Request
{
"address" => [
("subsystem" => "datasources"),
("data-source" => "OracleDS")
],
"operation" => "test-connection-in-pool"
}
Response
Internal Server Error
{
"outcome" => "failed",
"failure-description" => "JBAS010440: failed to invoke operation: JBAS010447: Connection is not valid",
"rolled-back" => true
}
And in the jboss console I found this:
在 jboss 控制台中,我发现了这个:
Caused by: java.sql.SQLException: ORA-00604: error occurred at recursive SQL lev
el 1
ORA-12705: Cannot access NLS data files or invalid environment specified
but the solutions to that error I found on the internet didn't help.
但是我在互联网上找到的那个错误的解决方案没有帮助。
What am I doing wrong?
我究竟做错了什么?
采纳答案by Mick Mnemonic
The ORA-12705
error suggests that this might be a locale issue. You could try starting up JBoss with a locale that is supported by Oracle XEwhen converted into an NLS. For example, try adding this to your JBoss startup configuration (JAVA_OPTS
variable in jboss-as/bin/run.conf
):
该ORA-12705
错误表明这可能是区域设置问题。您可以尝试在转换为 NLS 时使用 Oracle XE 支持的语言环境启动 JBoss 。例如,尝试将其添加到您的 JBoss 启动配置(JAVA_OPTS
变量 in jboss-as/bin/run.conf
):
-Duser.language=en -Duser.country=US