我刚刚在 Ubuntu 14.04 上安装了 Glassfish 4.1 并尝试对 DerbyPool 执行 ping 操作,但它因 java.net.ConnectException 而失败。
Ping Connection Pool failed for DerbyPool. Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused. Please check the server.log for more details.
服务器日志:
[2015-01-02T20:51:12.361+0200] [glassfish 4.1] [WARNING] [test.connection.pool.failed] [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service] [tid: _ThreadID=42 _ThreadName=admin-listener(4)] [timeMillis: 1420224672361] [levelValue: 900] [[ RAR8054: Exception while creating an unpooled [test] connection for pool [ DerbyPool ], Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused.]]
[2015-01-02T20:51:12.366+0200] [glassfish 4.1] [SEVERE] [] [org.glassfish.admingui] [tid: _ThreadID=40 _ThreadName=admin-listener(2)] [timeMillis: 1420224672366] [levelValue: 1000] [[ RestResponse.getResponse() gives FAILURE. endpoint = 'http://
localhost
:4848/management/domain/resources/ping-connection-pool.json'; attrs = '{id=DerbyPool}']]
在另一台安装了 Glassfish 4.1 和 Ubuntu 14.04 的计算机上出现了同样的问题。
最佳答案
我猜你没有启动 Derby 服务器。
要启动它,请转到命令行并导航到可以运行 asadmin
的文件夹(可能类似于 /glassfish/bin
)并运行以下命令:
asadmin start-database
然后再次尝试 ping。
关于java - Derby Pool ping 在 Glassfish 中因 java.net.ConnectException 而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27747479/