From: Lew <noone@lewscanon.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: jdbc works in java app, fails in servlet: "no suitable jdbc found"
Date: Sat, 05 Jun 2010 09:20:55 -0400
Message-ID: <hudivk$b2h$1@news.albasani.net> (raw)
In-Reply-To: <4C089FE4.5040006@hogranch.com>
References: <8CCD02714A2791E-E2C-7A83@webmail-m042.sysops.aol.com>
<4C05F409.7060805@postnewspapers.com.au>
<8CCD0CAC9B7220C-D8C-4F1C@webmail-d098.sysops.aol.com>
<4C071135.3020607@postnewspapers.com.au>
<8CCD1C0ABE41498-C10-62A5@webmail-d048.sysops.aol.com>
<4C089FE4.5040006@hogranch.com>
philfrei@aol.com wrote:
>> There is no .WAR file in this project. So I am unable to follow
>> related advice.
John R Pierce wrote:
> why not ? a .war file is the standard method of deploying a tomcat app.
My guess is that the OP didn't build the project, then.
> its a renamed .zip file that contains the project jars, xml manifest,
> related libraries, etc etc. to deploy the app (or an update) you simply
> drop the .war into the deployment dir, and tomcat sees it and unzips it
> into the /webapps/appname/ folder and off it goes
philfrei@aol.com wrote:
>> There is a .CLASSPATH file stored with the project.
It's actually a ".classpath" file. This is an Eclipse-specific file and only
instructs Eclipse how to set the classpath. It does not itself set the classpath.
The classpath for a web app is entirely under the programmer's control and
depends on putting the driver JAR in the WAR. The entry in the Eclipse
metafiles directs Eclipse to do that for you.
>> It has the following entry pertaining to the jdbc:
>> <classpathentry kind="con"
>> path="org.eclipse.datatools.connectivity.jdt.DRIVERLIBRARY/PostgreSQL JDBC Driver"/>
I find it convenient to do as Manohar suggested, "simply putting the jar file
in [the $]CATALINA_HOME/lib/ directory", because typically if one app needs to
access a particular database then many if not all apps in that app server will
need access to the same driver. It's only truly necessary if Tomcat itself
needs that driver, e.g., to handle authentication. Otherwise it should
suffice to put the JAR in the "WEB-INF/lib/" directory of the deployed app
(i.e., the WAR file).
philfrei, you do have a WAR file if you're deploying a web app. You must be
looking in the wrong place. Into what directory does Eclipse put its built files?
Also, did you read the Tomcat documentation? I posted a couple of relevant
links upthread.
--
Lew
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: noone@lewscanon.com
Subject: Re: jdbc works in java app, fails in servlet: "no suitable jdbc found"
In-Reply-To: <hudivk$b2h$1@news.albasani.net>
References: <8CCD02714A2791E-E2C-7A83@webmail-m042.sysops.aol.com> <4C05F409.7060805@postnewspapers.com.au> <8CCD0CAC9B7220C-D8C-4F1C@webmail-d098.sysops.aol.com> <4C071135.3020607@postnewspapers.com.au> <8CCD1C0ABE41498-C10-62A5@webmail-d048.sysops.aol.com> <4C089FE4.5040006@hogranch.com> <hudivk$b2h$1@news.albasani.net>
* 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