From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: Tomcat7 connection pool with postgresql
Date: Mon, 21 Nov 2011 12:21:18 +0300
Message-ID: <201111211121.19202.achill@matrix.gatewaynet.com> (raw)
In-Reply-To: <201111181338.52863.achill@matrix.gatewaynet.com>
References: <201111181109.28089.achill@matrix.gatewaynet.com>
<CAEV0TzBTtxpCEOzRz82KBTJyT78krrDudy4EkNmgu+vy3rM45A@mail.gmail.com>
<201111181338.52863.achill@matrix.gatewaynet.com>
Στις Friday 18 November 2011 13:38:52 γράψατε:
> Στις Friday 18 November 2011 13:13:18 ο/η Samuel Gendler έγραψε:
> > On Fri, Nov 18, 2011 at 1:09 AM, Achilleas Mantzios <
> > achill@matrix.gatewaynet.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
>
> Thanx, but i actually had gone this step and had placed in dist $CATALINA_HOME/lib already.
> Nothing explicit in the webapp about the driver.
> I am starting to suspect that this has to do with declaring the resource as global under GlobalNamingResources
> and forgetting to do the proper linkage xml in context. But i think it should be placed inside
> context, in the first place and scrapping the GlobalNamingResources altogether.
>
Now its ok, i had to declare the datasource inside META-INF/context.xml of the webapp.
Thanx! And indeed it was 100% tomcat-related ;)
> > 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.
> >
>
>
>
--
Achilleas Mantzios
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: achill@matrix.gatewaynet.com
Subject: Re: Tomcat7 connection pool with postgresql
In-Reply-To: <201111211121.19202.achill@matrix.gatewaynet.com>
References: <201111181109.28089.achill@matrix.gatewaynet.com> <CAEV0TzBTtxpCEOzRz82KBTJyT78krrDudy4EkNmgu+vy3rM45A@mail.gmail.com> <201111181338.52863.achill@matrix.gatewaynet.com> <201111211121.19202.achill@matrix.gatewaynet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox