users@glassfish.java.net

JDBC Pool unavailable induce failed deployment

From: Olivier Chorier <lapsus63_at_gmail.com>
Date: Fri, 8 Mar 2013 15:42:17 +0100

Hello,

My domain contains 2 JDBC pools. One is used for 99,99% of the
transactions, and the other one for 0.01% for other stuff.
I configured the persistence.xml with both persistence units.

This other pool is located in a remote server that is not 100% available
for network restrictions.

When I deploy my EAR, if the secondary pool isn't available (that means
ping timeout), the deployment fails with the following errors.

How can I set my pool "optional" and allow deployment even if the jdbc
server is not reachable ? I'd like to keep the connection parameters to
MySQL server side.

Thanks a lot for help.
Olivier.

----
ATTENTION: RAR5114 : Error allocating connection : [Erreur lors de
l'allocation d'une connexion. Cause : Connection could not be allocated
because: 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.]
GRAVE: Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services -
2.3.2.v20111125-r10461):
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Erreur lors de l'allocation
d'une connexion. Cause : Connection could not be allocated because:
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.
Error Code: 0
    at
org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:309)
    at
org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:135)
...
Caused by: java.sql.SQLException: Erreur lors de l'allocation d'une
connexion. Cause : Connection could not be allocated because:
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.
    at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:120)
    at
org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:123)
    ... 53 more
Caused by: javax.resource.spi.ResourceAllocationException: Erreur lors de
l'allocation d'une connexion. Cause : Connection could not be allocated
because: 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.
    at
com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:307)
    at
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:190)
    at
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
    at
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:160)
    at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:113)
    ... 54 more
Caused by: com.sun.appserv.connectors.internal.api.PoolingException:
Connection could not be allocated because: 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.
    at
com.sun.enterprise.resource.pool.datastructure.RWLockDataStructure.addResource(RWLockDataStructure.java:103)
 ...
Caused by: com.sun.appserv.connectors.internal.api.PoolingException:
Connection could not be allocated because: 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.
    at
com.sun.enterprise.resource.pool.ConnectionPool.createSingleResource(ConnectionPool.java:924)
    at
com.sun.enterprise.resource.pool.ConnectionPool.createResource(ConnectionPool.java:1189)
    at
com.sun.enterprise.resource.pool.datastructure.RWLockDataStructure.addResource(RWLockDataStructure.java:98)
    ... 70 more
Caused by: com.sun.appserv.connectors.internal.api.PoolingException:
Connection could not be allocated because: 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.
    at
com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator.createResource(LocalTxConnectorAllocator.java:110)
    at
com.sun.enterprise.resource.pool.ConnectionPool.createSingleResource(ConnectionPool.java:907)
    ... 72 more
Caused by: javax.resource.spi.ResourceAllocationException: Connection could
not be allocated because: 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.
    at
com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnectionFactory.java:129)
    at
com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator.createResource(LocalTxConnectorAllocator.java:87)
    ... 73 more
Caused by: 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.
    at sun.reflect.GeneratedConstructorAccessor189.newInstance(Unknown
Source)
...