Re: stupid question about loading driver
От | Anders Hermansen |
---|---|
Тема | Re: stupid question about loading driver |
Дата | |
Msg-id | 20030119172913.GA12347@online.no обсуждение исходный текст |
Ответ на | stupid question about loading driver (Richard Welty <rwelty@averillpark.net>) |
Ответы |
Re: stupid question about loading driver
|
Список | pgsql-jdbc |
* Richard Welty (rwelty@averillpark.net) wrote: > $ /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? When using the -jar command to start an application the CLASSPATH is ignored. I bet this will work: /usr/java/j2sdk1.4.1_01/jre/bin/java -cp $CLASSPATH:mosa.jar com.example.foo.ExampleFooApp Hope this helps, Anders -- Anders Hermansen YoYo Mobile as
В списке pgsql-jdbc по дате отправления: