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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 02:48:44  来源:igfitidea点击:

Jboss Oracle JDBC connection failed

javaoraclejdbcjbossoracle11g

提问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-12705error 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_OPTSvariable 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