Re: Tomcat7 connection pool with postgresql

From: Samuel Gendler <sgendler(at)ideasculptor(dot)com>
To: Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org, users(at)tomcat(dot)apache(dot)org
Subject: Re: Tomcat7 connection pool with postgresql
Date: 2011-11-18 11:13:18
Message-ID: CAEV0TzBTtxpCEOzRz82KBTJyT78krrDudy4EkNmgu+vy3rM45A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Fri, Nov 18, 2011 at 1:09 AM, Achilleas Mantzios <
achill(at)matrix(dot)gatewaynet(dot)com> wrote:
>
>
> root cause
> java.sql.SQLException: No suitable driver
> java.sql.DriverManager.getDriver(DriverManager.java:279)
>
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437)
>
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
>
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
> org.apache.jsp.index_jsp._jspService(index_jsp.java:102)
>
>
I think if you have tomcat instantiate the data source and db driver, the
jar file with the driver must be available to tomcat's class loader. Odds
are good that you have the driver packaged up with your webapp, which means
it is only available to the webapp's class loader. Move it to wherever
tomcat loads external jar files from (or add it to a classpath environment
variable that gets read by the tomcat startup script). A quickie place to
drop it to see if I'm correct is $CATALINA_HOME/lib but I don't think it is
recommend that you put it there permanently, since it will be mixed with
the jars that ship as part of tomcat in there.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Stevo Slavić 2011-11-18 11:21:10 PostgreSQL protocol 3 JDBC drivers, sub-protocols, and latency
Previous Message ml-tb 2011-11-18 10:06:22 Re: Tomcat7 connection pool with postgresql