You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by bob_b <ro...@renesys.com> on 2005/05/24 23:27:45 UTC

redeploy of webapp loses GlobalNamingResource DataSource

I have a globally named db pool resource that I use across multiple
contexts to access a particular database. When I redeploy a webapp in
Tomcat 5.0.28, I am losing the DataSource and getting a pooled
connection fails with the following (truncated) message:


org.apache.commons.dbcp
.SQLNestedException: Cannot create JDBC driver
of class '' for connect URL 'null'
=09at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou=
rce.java:780)
=09at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource=
.java:540)
.....

Caused by: java.lang.NullPointerException
=09at org.postgresql.Driver.parseURL(Driver.java:269)
=09at org.postgresql.Driver.acceptsURL(Driver.java:177)
=09at java.sql.DriverManager.getDriver(DriverManager.java:232)
=09at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou=
rce.java:773)
=09... 44 more......

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: redeploy of webapp loses GlobalNamingResource DataSource

Posted by Steve Kirk <to...@web-startup.co.uk>.
>From the look of the stacktrace, which mentions
"org.postgresql.Driver.parseURL" as the point where the initial exception
was thrown, maybe the URL attribute in your <Context>'s <Resource> or
<ResourceParams> might either contain a wrong value or a typo.  This might
be leading to a parsing exception, even though the trace doesn't say so
explicitly.

My experience is that the exceptions in these cases do not always give you a
very precise clue as to the problem.  For example, very recently on 5.5.9, I
was getting a similar problem to you, where just because I had a leading
space in the url attribute value, the whole DBCP resource was rejected, with
the exception messages "Cannot create JDBC driver of class '' for connect
URL 'null'" caused by "no suitable driver".

Check that config *extremely* carefully....

> -----Original Message-----
> From: bob_b [mailto:rob-tomcat@renesys.com] 
> Sent: Tuesday 24 May 2005 22:28
> To: tomcat-user@jakarta.apache.org
> Subject: redeploy of webapp loses GlobalNamingResource DataSource
> 
> 
> I have a globally named db pool resource that I use across multiple
> contexts to access a particular database. When I redeploy a webapp in
> Tomcat 5.0.28, I am losing the DataSource and getting a pooled
> connection fails with the following (truncated) message:
> 
> 
> org.apache.commons.dbcp
> .SQLNestedException: Cannot create JDBC driver
> of class '' for connect URL 'null'
> =09at 
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou=
> rce.java:780)
> =09at 
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource=
> .java:540)
> .....
> 
> Caused by: java.lang.NullPointerException
> =09at org.postgresql.Driver.parseURL(Driver.java:269)
> =09at org.postgresql.Driver.acceptsURL(Driver.java:177)
> =09at java.sql.DriverManager.getDriver(DriverManager.java:232)
> =09at 
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou=
> rce.java:773)
> =09... 44 more......
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org