1

如 oracle文档中所述,我正在尝试在 glassfish 服务器中设置数据库。我的 JDK 版本是 1.8,glassfish 是 4.1。我正在使用 ojdbc7.jar。

我已将 ojdbc 放入 \glassfish\domains\domain1\lib\ext 文件夹并重新启动服务器和数据库。但是当我尝试 ping 时,出现错误:

Ping Connection Pool failed for TestPool. Connection could not be allocated because: IO Error: The Network Adapter could not establish the connection

在 server.log 我发现:

2015-04-13T18:35:25.413+0530] [glassfish 4.1] [WARNING] [test.connection.pool.failed] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service] [tid: _ThreadID=45 _ThreadName=admin-listener(2)] [timeMillis: 1428930325413] [levelValue: 900] [[
  RAR8054: Exception while creating an unpooled [test] connection for pool [ TestPool ], Connection could not be allocated because: IO Error: The Network Adapter could not establish the connection]]

但我可以成功ping通默认在glassfish中的“Derby Pool”。我已经设置了文档中提到的所有连接池属性和 JVM 选项。

有人可以帮忙正确设置吗?

提前致谢。

4

2 回答 2

0

驱动程序似乎在连接到 oracle 实例时出现问题。

确保您可以建立从 glassfish 到 oracle 服务器的连接。特别是检查主机名/端口(默认oracle端口号是1521)。

于 2015-04-13T13:39:40.657 回答
0

这是我的设置的快照: 在此处输入图像描述

在此处输入图像描述

但是在尝试 ping 时,我在服务器日志中发现了这些:

RAR8054: Exception while creating an unpooled [test] connection for pool [ TEST ], Connection could not be allocated because: IO Error: The Network Adapter could not establish the connection]]

这是由于服务器错误,因为我使用的是 glassfish 4.1。

于 2015-04-13T19:24:23.913 回答