Re: jdbc works in java app, fails in servlet: "no suitable jdbc found"
От | Lew |
---|---|
Тема | Re: jdbc works in java app, fails in servlet: "no suitable jdbc found" |
Дата | |
Msg-id | hudivk$b2h$1@news.albasani.net обсуждение исходный текст |
Ответ на | Re: jdbc works in java app, fails in servlet: "no suitable jdbc found" (John R Pierce <pierce@hogranch.com>) |
Список | pgsql-jdbc |
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
В списке pgsql-jdbc по дате отправления: