stupid question about loading driver

From: Richard Welty <rwelty(at)averillpark(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: stupid question about loading driver
Date: 2003-01-19 01:33:45
Message-ID: E18a4LK-00016F-00@skipper.averillpark.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

i have a standalone java application that i've been developing in netbeans
for a couple of months now. it's time that i got it working outside of the
netbeans IDE so that i can deploy a test box at the client site for them to
try and break.

i'm a relative novice at java, and the exercise in getting the code to work
outside of the ide has been interesting. right now, i'm stuck at a jdbc
driver problem. the driver loads up and runs fine with the program inside
of the ide. when the classes are in a jar file, the program fails with the
traditional error message (pardon the obfuscation of some names, but i'm
NDA'd here). since i just print an error message when i should also be
exiting when the driver isn't found, it goes on to fail when the driver
still isn't found (duh. i should probably fix that.).

$ /usr/java/j2sdk1.4.1_01/jre/bin/java -jar mosa.jar com.example.foo.ExampleFooApp
Using config file path: /home/rwelty/foo.cfg
ClassNotFoundException: org.postgresql.Driver
DBInstance: connecting to jdbc:postgresql://localhost:5432/foo-db
SQLException: No suitable driver
Exception in thread "main" java.lang.NullPointerException
at com.example.foo.InstanceInfo.LoadSiteInfo(InstanceInfo.java:126)
at com.example.foo.ExampleFooApp.main(MOSAScaleApp.java:8673)
$

the classpath looks fine to me, it includes the location of the correct
driver (the one that was working inside the IDE):

$ echo $CLASSPATH
/usr/java/j2sdk1.4.1_01/jre/lib/rt.jar:/usr/local/java/lib/pgjdbc2.jar
$

so what am i missing here?

thanks in advance,
richard
--
Richard Welty rwelty(at)averillpark(dot)net
Averill Park Networking 518-573-7592
Unix, Linux, IP Network Engineering, Security

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Abel Muiño 2003-01-19 11:40:13 Re: stupid question about loading driver
Previous Message Marek Kałużny 2003-01-18 23:59:37 Type casting