title: (Enterprise GlassFish v3 build 11) Communication link problem (MySQL DB)
body: <p>I get a communication link failure while application tries to establish a connection with DB.</p>
  
  <pre><code>[#|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.|#]
  </code></pre>
  
  <p>Precisely at this string:</p>
  
  <pre><code>Statement s = conn.createStatement();
  </code></pre>
  
  <p>where <strong>conn</strong> is defined as follows:</p>
  
  <pre><code>private static java.sql.Connection conn;
  </code></pre>
  
  <p>For this app I have set a connection pool with default parameters and currently it (app) uses both JPA and direct JDBC queries. Recreation of connection pool gave nothing, connection pool ping gave next message:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>and flushing the connection pool gave:</p>
  
  <pre><code>com.sun.enterprise.admin.cli.CommandException: remote failure: Failed to flush connection pool ...
  </code></pre>
  
  <p>However I can connect to the database from a terminal. Besides I have the same app working on my local machine with identical connection pool settings.</p>
  
  <p>Any one has an idea on whats going on or how to solve the trouble?</p>