jboss 与 oracle db - 连接问题

发布于 2024-10-19 12:46:56 字数 1920 浏览 3 评论 0原文

我花了两个小时在连接到 Oracle DB 的 Jboss 服务器上部署应用程序。

dbname-ds.xml 具有:

<datasources>
    <local-tx-datasource>
        <jndi-name>dbnameDatasource</jndi-name>
        <use-java-context>false</use-java-context>
        <connection-url>jdbc:oracle:thin:@192.168.168.105:1521:XE</connection-url>
        <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
        <user-name>system</user-name>
        <password>password</password>
    </local-tx-datasource>
</datasources>

凭据正常,因为我已经使用 Oracle 的 DataBase 主页工具对其进行了测试。

我在 jboss 中收到的错误是:

  00:14:28,383 INFO  [ConnectionProviderFactory] Initializing connection provider:
 org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
00:14:28,389 INFO  [InjectedDataSourceConnectionProvider] Using provided datasou
rce
00:14:49,476 WARN  [JBossManagedConnectionPool] Throwable while attempting to ge
t a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested
 throwable: (java.sql.SQLException: Io exception: The Network Adapter could not
establish the connection)
        at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.g
etLocalManagedConnection(LocalManagedConnectionFactory.java:225)

//etc

并由以下原因引起:

 Caused by: java.sql.SQLException: Io exception: The Network Adapter could not es
tablish the connection
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:112)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java

你知道去哪里看吗?

我还将 ds 文件中的默认 localhost 修改为我的 ip:

(地址 =(协议 = TCP)(主机 = 192.168.168.105)(端口 = 1521))

因此主机和端口是正确的。

还有什么原因......?

多谢...

I'm struggling for two hours to deploy an application on Jboss server which connects to my Oracle DB.

The dbname-ds.xml has:

<datasources>
    <local-tx-datasource>
        <jndi-name>dbnameDatasource</jndi-name>
        <use-java-context>false</use-java-context>
        <connection-url>jdbc:oracle:thin:@192.168.168.105:1521:XE</connection-url>
        <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
        <user-name>system</user-name>
        <password>password</password>
    </local-tx-datasource>
</datasources>

The credentials are ok because I've tested them using DataBase home page tool from Oracle.

The error I receive in jboss is:

  00:14:28,383 INFO  [ConnectionProviderFactory] Initializing connection provider:
 org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
00:14:28,389 INFO  [InjectedDataSourceConnectionProvider] Using provided datasou
rce
00:14:49,476 WARN  [JBossManagedConnectionPool] Throwable while attempting to ge
t a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested
 throwable: (java.sql.SQLException: Io exception: The Network Adapter could not
establish the connection)
        at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.g
etLocalManagedConnection(LocalManagedConnectionFactory.java:225)

//etc

and caused by:

 Caused by: java.sql.SQLException: Io exception: The Network Adapter could not es
tablish the connection
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:112)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java

Do you have any idea where to look?

I've also modified the default localhost to be my ip from ds file:

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.168.105)(PORT = 1521))

so the host and port is correct.

What else can be the cause...?

Thanks a lot...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文