X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2F30AD1B442 for ; Fri, 2 Jul 2004 01:37:42 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 81146-08 for ; Fri, 2 Jul 2004 04:37:38 +0000 (GMT) Received: from longfellow.nbrewer.com (nbrewer.dsl.visi.com [208.42.141.101]) by svr1.postgresql.org (Postfix) with ESMTP id 91155D1B3C2 for ; Fri, 2 Jul 2004 01:37:37 -0300 (ADT) Received: by longfellow.nbrewer.com (Postfix, from userid 1000) id 382F615804A; Thu, 1 Jul 2004 23:37:37 -0500 (CDT) Date: Thu, 1 Jul 2004 23:37:37 -0500 From: Christopher Farley To: pgsql-jdbc@postgresql.org Subject: Puzzling Unix CLASSPATH issue... Message-ID: <20040702043729.GA2199@northernbrewer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/9 X-Sequence-Number: 10393 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