[GLASSFISH-20094] Undeploy on Glassfish causes connection pool to be no more usable (Grails) Created: 28/Mar/13  Updated: 25/Jun/13

Status: Open
Project: glassfish
Component/s: grails
Affects Version/s: 3.1.2.2
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: pierre.fabier.camineo Assignee: vivekp
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 3.1.2.2
Grails 2.2.1
Windows 7 or Debian


Tags: admin-gui, classloader, datasource, driver, grails, jdbc, jndi, postgresql

 Description   

Hi,

I'm working on a grails 2.2.1 project running on glassfish 3.1.2.2, using a jndi pooled datasource connected to a postgres 9.2 database.
When I deploy for the first time the application, I have no issues, everything works fine.

But, everytime I undeploy (or redeploy) my application, my connection pool stops working.
If I try to ping using glassfish admin console, I get this error :

Avertissement: RAR8054: Exception while creating an unpooled [test] connection for pool [ sample ], Connection could not be allocated because: No suitable driver found for jdbc:postgresql://localhost:5432/sample?loginTimeout=0&socketTimeout=0&prepareThreshold=5&unknownLength=2147483647&loglevel=0&tcpkeepalive=false
Grave: RestResponse.getResponse() donne FAILURE. endpoint = http://localhost:4848/management/domain/resources/ping-connection-pool.json ; attrs =

{id=sample}

'

I repeat : my connection pool works fine when I deploy (I have the postgresql driver in "/glassfish/lib", my connection pool is correctly configured, etc.), it's only when I undeploy that I have troubles.
This bug is highly reproductible, I even did a small grails project that reproduces the problem, you only need to have to configure a jndi datasource connected to a "sample" database (jndi/sample) on your glassfish server.

Here is the github link :
https://github.com/fabier/GlassfishJDBCGrailsPostgresql
And the war :
https://www.dropbox.com/s/cb9hmgc6lfabl5x/GlassfishJDBCGrailsPostgresql-0.1.war
and the domains.xml file:
https://www.dropbox.com/s/ljealpfp0zxj2r4/domain.xml

On grails side, my connection to the pool is configured this way:
environments {
production {
dataSource

{ dbCreate = "create-drop" jndiName = "jdbc/sample" }

}
}

I think this bug is severe, since it kills a connection pool that can be shared amongst other webapps or ears.
For information, I did a bit of research, sensing it might be some sort of class unloader associated with undeployment, I found log4j that could be linked to this problem, so I tryed :
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
but it didn't help.
Last point : in fact, postgresql driver is fully unloaded, so that other connection pools using postgresql driver are not usable after an undeploy.

Please help.
Thanks.

Pierre FABIER
Ingénieur d'Etude
Parc technologique du canal
13, avenue de l'Europe
31520 Ramonville-Saint-Agne (France)
Tel: 09 74 77 14 21 - Fax: 09 59 64 78 74
www.camineo.com



 Comments   
Comment by pierre.fabier.camineo [ 28/Mar/13 ]

Link to same issue on grails ML:
http://grails.1312388.n4.nabble.com/Undeploy-on-Glassfish-causes-connection-pool-to-be-no-more-usable-td4643041.html

Comment by pierre.fabier.camineo [ 08/Apr/13 ]

Re,

I did some investigations:

  • If I use MySQL instead of PostgreSQL (after changing the driver and re-configuring the pool), I cannot reproduce this problem. So PostgreSQL is involved in this problem too.
  • If I use Tomcat instead of Glassfish, I cannot reproduce this problem. So Glassfish is involved.
  • If I do not use grails, and deploy a standard J2EE app like «petstore» (<a href="http://www.oracle.com/technetwork/java/petstore1-3-1-02-139690.html">link</a>) using PostgreSQL jndi datasource, I cannot reproduce the problem. So Grails is involved too.
  • If I use Glassfish 3.0, Glassfish 3.1 or Glassfish 3.1.2.2, I still reproduce the problem, so the version of glassfish doesn't change anything.
  • If I use PostgreSQL 9.0, PostgreSQL 9.1 or PostgreSQL 9.2, I still reproduce the problem, so the version of PostgreSQL doesn't change anything.
  • Most incredible thing I discovered (that made me fall out of my chair) : If I undeploy a grails app using a MySQL datasource on a glassfish server that declares a UNUSED connection pool to a PostgreSQL database, the MySQL pool still works, but the PostgreSQL pool doesn't !!! it shows the «No suitable driver found» error, as there was no problem prior to undeploying.

Please help me, I'm stuck with this problem, and no one seems to be able to answer me.


Pierre FABIER
Ingénieur d'Etude
Parc technologique du canal
13, avenue de l'Europe
31520 Ramonville-Saint-Agne (France)
Tel: 09 74 77 14 21 - Fax: 09 59 64 78 74

Comment by pierre.fabier.camineo [ 25/Jun/13 ]

I posted this message 3 months ago, can someone help me with this, please ?


Pierre FABIER
Ingénieur d'Etude
Parc technologique du canal
13, avenue de l'Europe
31520 Ramonville-Saint-Agne (France)
Tel: 09 74 77 14 21 - Fax: 09 59 64 78 74





Generated at Wed May 06 02:52:23 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.