Re: Tomcat - PostgreSQL - Cannot load JDBC driverclass"null" - Mailing list pgsql-jdbc

From Jim Wright
Subject Re: Tomcat - PostgreSQL - Cannot load JDBC driverclass"null"
Date
Msg-id 3F74F397.5090904@quick.cz
Whole thread Raw
In response to Re: Tomcat - PostgreSQL - Cannot load JDBC driverclass"null"  ("CRAIG GOLBY" <craig@golby.me.uk>)
List pgsql-jdbc
Hi Craig,

CRAIG GOLBY wrote:

 >There are a number of other dirs under WebApps, those being "examples",
 >"tomcat-docs" and "webdav", plus a few backups or ROOT that I have
 >created at different stages of the build.
 >
 >There is also an admin.xml and manager.xml file in the webapps
 >directory, both have small amounts of information in them, not sure that
 >they have any bearing.

You can either define web apps in server.xml or in files like these.
You may well find these two useful in your current situation.

Manager is for stopping, starting, restarting webapps and helps
if you are making changes.

Administrator allows you to set up datasources which is cool but
strikes me as ambitious until you have got it working with:

Connection db = DriverManager.getConnection(
     "jdbc:postgresql://host:port/database", username, password);

Anyway, by default the ROOT web app just displays the tomcat test page
which has links to the admin and manager web apps.

If you don't have the tomcat test page (e.g. because you have
broken the default config ;-)) then for tomcat 4 on RH 8.0 the
above are at:

http://localhost:8080/manager/html
http://localhost:8080/admin

until you break that too ;-)

You will be asked to log in as a user defined in
Tomcat/conf/tomcat-users.xml e.g.:

<user username="admin" password="4gotenit" fullName="Adminstrator" roles="admin,manager"/>

 >>>>>>*******************************************************
 >>>>>>Server XML :- Tomcat/conf
 >>>>>>*******************************************************
 >>>>>><Context path="/DBTest"
 >>>>>>         docBase="DBTest"
 >>>>>>         debug="5"
 >>>>>>         reloadable="true"
 >>>>>>         crossContext="true">

I think this means that your web app is installed at Tomcat/webapps/DBTest
assuming you have:

<Host name="localhost" debug="0" appBase="webapps" ...

earlier in the file.

 >>>>>>
 >>>>>>*******************************************************
 >>>>>>Web XML  :-  Tomcat/webapps/root/WEB-INF
 >>>>>>*******************************************************

I think this is the wrong file. You probably also
have this in server.xml:

<Context path="" docBase="root" debug="0"/>

which relates to Tomcat/webapps/root.

I suggest you get it working by installing your web app in:

Tomcat/webapps/DBTest/

Copy the "examples" web app if its there. Just change occurrences
of "examples" to "DBTest" and install your own:

Tomcat/webapps/DBTest/WEB-INF/web.xml.

test classes in:

Tomcat/webapps/DBTest/WEB-INF/classes

and:

Tomcat/webapps/DBTest/WEB-INF/lib/pg73jdbc3.jar

BTW I recommend that on a development machine you eventually
configure virtual hosts and keep your original tomcat default
webapps installed on one e.g. http://tomcat/ and install your
own stuff elsewhere. e.g. http://DBtest/.

I'd be interested to know how you get on defining data sources.
I've not tried.

Cheers,

Jim Wright

--
Recently completed - Child Brain Injury Trust
Admin System
http://cbitdemo.paneris.org/

Urgently seeking paid work
Java, Linux, XML and much more.
http://be.webz.cz/





pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: initdb failure (was Re: [GENERAL] sequence's plpgsql)
Next
From: Barry Lind
Date:
Subject: Re: problem with setting boolean value on AbstractJdbc1Statement