アプリケーションが DB との接続を確立しようとすると、通信リンク障害が発生します。
[#|2010-04-08T20:09:57.825+0300|SEVERE|glassfish3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=24;_ThreadName=Thread-1;|Cannot connect to database server = com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.|#]
正確にはこの文字列で:
Statement s = conn.createStatement();
ここで、connは次のように定義されます。
private static java.sql.Connection conn;
このアプリでは、デフォルトのパラメーターで接続プールを設定しました。現在、(アプリ) は JPA クエリと直接 JDBC クエリの両方を使用しています。接続プールを再作成しても何も返されず、接続プールの ping で次のメッセージが表示されました。
Ping Connection Pool for pool is Failed. Ping failed Exce
ption - Connection could not be allocated because: Communications lin
k failure%%%EOL%%%%%%EOL%%%The last packet sent successfully to the s
erver was 0 milliseconds ago. The driver has not received any packets
from the server. Please check the server.log for more details.%%%EOL
%%%Ping failed Exception - Connection could not be allocated because:
Communications link failure
接続プールをフラッシュすると、次のようになりました。
com.sun.enterprise.admin.cli.CommandException: remote failure: Failed to flush connection pool ...
ただし、端末からデータベースに接続できます。さらに、同じ接続プール設定を使用して、ローカルマシンで同じアプリを動作させています。
何が起こっているのか、または問題を解決する方法について考えている人はいますか?