stupid question about loading driver

Поиск
Список
Период
Сортировка
От Richard Welty
Тема stupid question about loading driver
Дата
Msg-id E18a4LK-00016F-00@skipper.averillpark.net
обсуждение исходный текст
Ответы Re: stupid question about loading driver  (Abel Muiño <abel.muinho@mundo-r.com>)
Re: stupid question about loading driver  (Anders Hermansen <anders@yoyo.no>)
Список 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@averillpark.net
Averill Park Networking                                         518-573-7592
              Unix, Linux, IP Network Engineering, Security

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: Postgresql 7.3.1 + JDBC Build from Source
Следующее
От: Marek Kałużny
Дата:
Сообщение: Type casting