pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedPuzzling Unix CLASSPATH issue...
3+ messages / 2 participants
[nested] [flat]
* Puzzling Unix CLASSPATH issue...
@ 2004-07-02 04:37 Christopher Farley <chris@northernbrewer.com>
0 siblings, 1 reply; 3+ messages in thread
From: Christopher Farley @ 2004-07-02 04:37 UTC (permalink / raw)
To: pgsql-jdbc
I recently upgrade from Postgresql 7.3 to 7.4. Of course, I am using the
new jdbc driver.
When I log into my Unix machine under one account, the driver works
great and I connect to the database with no trouble. When I log into the
machine under a different user, I get a ClassNotFoundException.
I've examined my postgresql configuration, permissions, etc., and it
appears to be identical to my 7.3 config, which worked fine.
Any ideas on what is happening? Thanks...
Simple test case follows:
--------- DataBase.java --------
import java.io.*;
import java.sql.*;
public class DataBase
{
public static void main(String args[])
{
try {
Class.forName("org.postgresql.Driver");
} catch (ClassNotFoundException cnfe) {
System.err.println("Couldn't find driver class:");
cnfe.printStackTrace();
}
System.out.println("Testing");
}
}
-------- Example of problem -------
chris:~/test> export CLASSPATH=/usr/local/jdk1.4.2/jre/lib/rt.jar:.:pg74.214.jdbc3.jar; java DataBase
Testing
chris:~/test> su fred
Password:
fred:/home/chris/test> export CLASSPATH=/usr/local/jdk1.4.2/jre/lib/rt.jar:.:pg74.214.jdbc.jar; java DataBase
Couldn't find driver class:
java.lang.ClassNotFoundException: org.postgresql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at DataBase.main(DataBase.java:11)
Testing
fred:/home/chris/test>
--
Christopher Farley
www.northernbrewer.com
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Puzzling Unix CLASSPATH issue...
@ 2004-07-02 04:58 Oliver Jowett <oliver@opencloud.com>
parent: Christopher Farley <chris@northernbrewer.com>
0 siblings, 1 reply; 3+ messages in thread
From: Oliver Jowett @ 2004-07-02 04:58 UTC (permalink / raw)
To: Christopher Farley <chris@northernbrewer.com>; +Cc: pgsql-jdbc
Christopher Farley wrote:
> chris:~/test> export CLASSPATH=/usr/local/jdk1.4.2/jre/lib/rt.jar:.:pg74.214.jdbc3.jar; java DataBase
> Testing
> chris:~/test> su fred
> Password:
> fred:/home/chris/test> export CLASSPATH=/usr/local/jdk1.4.2/jre/lib/rt.jar:.:pg74.214.jdbc.jar; java DataBase
> Couldn't find driver class:
> java.lang.ClassNotFoundException: org.postgresql.Driver
Check the permissions on the driver jarfile; perhaps it is not readable
as 'fred'.
-O
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Puzzling Unix CLASSPATH issue...
@ 2004-07-02 05:11 Christopher Farley <chris@northernbrewer.com>
parent: Oliver Jowett <oliver@opencloud.com>
0 siblings, 0 replies; 3+ messages in thread
From: Christopher Farley @ 2004-07-02 05:11 UTC (permalink / raw)
To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc
Oliver Jowett (oliver@opencloud.com) wrote:
> Check the permissions on the driver jarfile; perhaps it is not readable
> as 'fred'.
Wow, thank you. One of the first things I did was check the permissions,
and I believed they were right. I didn't really look at them again until
I read your message. Thank you... now I can go to sleep!
--
Christopher Farley
www.northernbrewer.com
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2004-07-02 05:11 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-02 04:37 Puzzling Unix CLASSPATH issue... Christopher Farley <chris@northernbrewer.com>
2004-07-02 04:58 ` Oliver Jowett <oliver@opencloud.com>
2004-07-02 05:11 ` Christopher Farley <chris@northernbrewer.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox