Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id A183B105A46A for ; Mon, 21 Nov 2011 05:21:37 -0400 (AST) Received: from host3.dynacom.ondsl.gr ([62.103.35.211] helo=smadev.internal.net) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RSQ4C-00066F-Of for pgsql-jdbc@postgresql.org; Mon, 21 Nov 2011 09:21:37 +0000 Received: from smadev.internal.net (localhost.internal.net [127.0.0.1]) by smadev.internal.net (8.14.2/8.14.2) with ESMTP id pAL9LJOn060234 for ; Mon, 21 Nov 2011 11:21:19 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.14.2/8.14.2/Submit) id pAL9LJTV060233 for pgsql-jdbc@postgresql.org; Mon, 21 Nov 2011 11:21:19 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: pgsql-jdbc@postgresql.org Subject: Re: Tomcat7 connection pool with postgresql Date: Mon, 21 Nov 2011 12:21:18 +0300 User-Agent: KMail/1.9.7 References: <201111181109.28089.achill@matrix.gatewaynet.com> <201111181338.52863.achill@matrix.gatewaynet.com> In-Reply-To: <201111181338.52863.achill@matrix.gatewaynet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201111211121.19202.achill@matrix.gatewaynet.com> X-Archive-Number: 201111/60 X-Sequence-Number: 22395 =CE=A3=CF=84=CE=B9=CF=82 Friday 18 November 2011 13:38:52 =CE=B3=CF=81=CE= =AC=CF=88=CE=B1=CF=84=CE=B5: > =CE=A3=CF=84=CE=B9=CF=82 Friday 18 November 2011 13:13:18 =CE=BF/=CE=B7 S= amuel Gendler =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > > 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(BasicDa= taSource.java:1371) > > > > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataS= ource.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, t= he > > jar file with the driver must be available to tomcat's class loader. O= dds > > are good that you have the driver packaged up with your webapp, which m= eans > > it is only available to the webapp's class loader. Move it to wherever >=20 > 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 sh= ould be placed inside > context, in the first place and scrapping the GlobalNamingResources altog= ether. >=20 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 environm= ent > > 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 i= t is > > recommend that you put it there permanently, since it will be mixed with > > the jars that ship as part of tomcat in there. > >=20 >=20 >=20 >=20 =2D-=20 Achilleas Mantzios