Re: 7.0 - 7.2 upgrade, org.postgresql.Driver Class not found

From: Dave Cramer <Dave(at)micro-automation(dot)net>
To: Harrison <huhl(at)email-services(dot)net>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: 7.0 - 7.2 upgrade, org.postgresql.Driver Class not found
Date: 2002-08-31 00:18:20
Message-ID: 1030753101.12928.464.camel@inspiron.cramers
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Harrison,

Ok, can you try loading the driver with some little main

ie

public class someClass
{
public static void main( String [] args ) throws Exception
{
class.forName("org.postgresql.Driver");
}
}

just to see if it works

Then we can narrow down what's up with jserv

Dave

On Fri, 2002-08-30 at 18:35, Harrison wrote:
> Dave:
>
> Thanks for your support.
>
> I've rolled back to our Postgres 7.0 server, and after several mistaken attempts
> at selecting the appropriate old driver have the application back up.
>
> What is interesting is that various of the old drivers also produced the same
> Class not found that I'm having with the upgrade.
>
> Is it possible that when the driver attempts to load and finds that something
> doesn't match that the load fails and you get the class not found message?
>
> I know with the IBM JVM I'm using, I get compile time Class not Found errors when
> the class exists, but one of the classes it requires is not found.
>
>
> The following code loads the specific database jdbc driver(s). Here
> org.postgres.Driver
> (The input string is pulled from an LDAP directory, and is tokenized so that
> databases like IBM's DB2, which at least in an older version, wants to load two
> separate classes.)
>
> public void loadDrivers(String s) throws Exception
> { StringTokenizer st= new StringTokenizer(s);
> while (st.hasMoreTokens()) { Class.forName(st.nextToken()); }
> }
>
> As mentioned above, once I got the proper older driver respecified, the older
> Postgres came up.
>
> The older driver I am currently using is pg71/jdbc7.1-1.2.jar, and this is going
> to Postgres 7.0 on a separate machine.
>
> The following comes from jdbc meta data queries for the above older configuration.
>
> product: PostgreSQL
> ver: 7.0.3
> driver: 7.1
> driver name: PostgreSQL Native Driver
>
>
> below are the configuration line from jserv.properties that specify where to look
> for the relevant driver, following that is a directory listing of the jars in
> question
> (they are being viewed over a Samba share, thus are in DOS, not Linux format)
>
>
> # wrapper.classpath=/java/org/postgresql/pg70/jdbc7.0-1.2.jar class not
> found
> # wrapper.classpath=/java/org/postgresql/pg71/jdbc7.0-1.1.jar
> wrapper.classpath=/java/org/postgresql/pg71/jdbc7.1-1.2.jar works
> #wrapper.classpath=/java/org/postgresql/devpgjdbc2.jar class
> not found
> #wrapper.classpath=/java/org/postgresql/pgjdbc2.jar class
> not found
> # wrapper.classpath=/java/org/postgresql/pg72/jdbc7.1-1.1.jar
> # wrapper.classpath=/java/org/postgresql/pg72/jdbc7.1-1.2.jar
>
>
>
> Directory of F:\java\org\postgresql
>
> 08/28/02 05:59p 116,705 pgjdbc2.jar
> 08/29/02 07:18p 143,767 devpgjdbc2.jar
> 2 File(s) 260,472 bytes
>
> Directory of F:\java\org\postgresql\pg71
>
> 03/08/02 01:07p 177,517 jdbc7.0-1.1.jar
> 03/08/02 01:07p 88,169 jdbc7.1-1.2.jar
> 2 File(s) 265,686 bytes
>
> Directory of F:\java\org\postgresql\pg70
>
> 09/17/01 02:08p 177,517 jdbc7.0-1.1.jar
> 09/17/01 02:08p 193,431 jdbc7.0-1.2.jar
> 2 File(s) 370,948 bytes
>
> Directory of F:\java\org\postgresql\pg72
>
> 03/08/02 11:49a 84,799 jdbc7.1-1.1.jar
> 03/08/02 11:49a 93,011 jdbc7.1-1.2.jar
> 03/08/02 11:49a 101,294 jdbc7.2dev-1.1.jar
> 03/08/02 11:49a 116,198 jdbc7.2dev-1.2.jar
> 4 File(s) 395,302 bytes
>
> I double checked the file permissions, and both pgjdbc2.jar and pg71/jdbc7.1-1.2
> (now) have the same: -rwxr-xr-x, and both files are owned by the same owner. and
> their directories also have matching (dir to dir) permissions and both dir's have
> the same owner.
>
> When I went back to see if the permissions were the same, they were not, so I
> changed them and double checked. (No luck.)
>
> When I was rolling back to the working older set, I inadvertently pointed the
> 7.1-1.2 drive at the 7.2.2 db, and got the same Class not found error.
>
> I'm strongly thinking that the actual error message is not at all indicative of
> what is going on.
>
> (However when I try to reproduce the old driver, new db, I can't reproduce that
> error, so it seems something is caching something.)
>
> Following is the stack trace of the attempt to load pgjdbc2.jar
> The indented lines are those from my application.
>
> Exception: java.lang.ClassNotFoundException: org.postgresql.Driver
> at java.lang.Throwable.(Throwable.java:96)
> at java.lang.Exception.(Exception.java:44)
> at java.lang.ClassNotFoundException.(ClassNotFoundException.java:71)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:325)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:380)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:257)
> at org.gjt.jsp.JspClassLoader.loadClass(JspClassLoader.java:51)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:257)
> at java.lang.Class.forName1(Native Method)
> at java.lang.Class.forName(Class.java:134)
> at DataBaseEngine.loadDrivers(DataBaseEngine.java:36)
> at DataBaseEngine.(DataBaseEngine.java:16)
> at LdapLocator.getDataBaseEngine(LdapLocator.java:54)
> at Dsn.(Dsn.java:35) at LdapLocator.getDSN(LdapLocator.java:61)
> at LdapLocator.getAppDSN(LdapLocator.java:65)
> at Application.getAppDSN(Application.java:167)
> at Application.getMainDsn(Application.java:172)
> at Application.addATV(Application.java:116)
> at DbDef.addATVs(DbDef.java:79)
> at Application.initAfterDbDef(Application.java:118)
> at Application.setDbDef(Application.java:160)
> at jsp__nln__preview_2ejsp.jspInit(jsp__nln__preview_2ejsp.java:61)
> at org.gjt.jsp.HttpJspPageImpl.init(HttpJspPageImpl.java:61)
> at org.gjt.jsp.JspServlet$Page.process(JspServlet.java:632)
> at org.gjt.jsp.JspServlet.service(JspServlet.java:284)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
> at org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)
> at org.apache.jserv.JServConnection.run(JServConnection.java:188)
> at java.lang.Thread.run(Thread.java:498)
>
>
> The following is a dump of System.getProperties() (which I have reformatted
> somewhat)
>
> java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition,
> sun.boot.library.path=/opt/IBMJava2-13/jre/bin,
> java.vm.version=1.3.0,
> java.vm.vendor=IBM Corporation,
> java.vendor.url=http://www.ibm.com/,
> path.separator=:,
> java.vm.name=Classic VM,
> file.encoding.pkg=sun.io,
> java.vm.specification.name=Java Virtual Machine Specification,
> user.dir=/,
> java.runtime.version=1.3.0,
> java.fullversion=J2RE 1.3.0 IBM build cx130-20001025 (JIT enabled: jitc),
> java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment,
> os.arch=x86,
> java.io.tmpdir=/tmp,
> line.separator= ,
> java.vm.specification.vendor=Sun
> Microsystems Inc.,
> java.awt.fonts=,
> os.name=Linux,
> java.library.path=/opt/IBMJava2-13/jre/bin:/opt/IBMJava2-13/jre/bin/classic::/usr/lib,
>
> java.specification.name=Java Platform API Specification,
> java.class.version=46.0,
> os.version=2.2.17-14,
> user.home=/home/wwwJserv,
> user.timezone=America/New_York,
> java.awt.printerjob=sun.awt.motif.PSPrinterJob,
> file.encoding=ANSI_X3.4-1968,
> java.specification.version=1.2,
> java.class.path=/usr/lib/apache/ApacheJServ.jar:/usr/wsn/java/jsdk.jar
> :/usr/wsn/java/servlet.jar:/usr/wsn/java/gnujsp.jar
> :/usr/wsn/java/wsn:/usr/wsn/java/db2java.zip
> :/java/org/postgresql/pg71/jdbc7.1-1.2.jar:/java/
> :/java/org/apache/lucene/lucene-1.2-rc4.jar
> :/java/com/sun/javamail/javamail-1.2/mail.jar,
>
> user.name=wwwJserv,
> java.vm.specification.version=1.0,
> java.home=/opt/IBMJava2-13/jre,
> user.language=en,
> java.specification.vendor=Sun Microsystems Inc.,
> java.vm.info=J2RE 1.3.0 IBM build cx130-20001025 (JIT enabled: jitc),
> java.version=1.3.0,
> java.ext.dirs=/opt/IBMJava2-13/jre/lib/ext,
> sun.boot.class.path=/opt/IBMJava2-13/jre/lib/rt.jar
> :/opt/IBMJava2-13/jre/lib/i18n.jar
> :/opt/IBMJava2-13/jre/classes,
>
> java.vendor=IBM Corporation,
> file.separator=/,
> java.vendor.url.bug=,
> java.compiler=jitc,
> sun.io.unicode.encoding=UnicodeBig
>
>
> The following is from snoop.jsp: Server Info: ApacheJServ/1.1.2/ GNUJSP 1.0
> wrapper
>
> Snoop also reminded me that we are using an older compiler for our classes, and my
> partner reminded me that we'd had issues running GNUJSP with our classes when we
> ran the new compiler. Since this error seems to come from well down in the system
> libraries, I doubt that its had any contact with our byte code, so I don't think
> this likely to be a factor.
>
> I'm also remembering a problem I had years ago with trying to get an application
> to run on Visual Cafe's JVM. The jdbc driver seemed to load and test fine but the
> application would Watson (NT), after much frustration, when I used the Sun JVM the
> problem vanished.
>
> Is anyone else successfully running pgjdbc2.jar with the IBMJava2-13 JVM?
>
> Still stumped, but thanks for the support...
>
> Harrison
>
> ----
> Separately the following is what I get when I try to point the 7.1-1.2 driver at
> the 7.2.2 database and try a getColumns()
> As this is an old driver with new database, this is probably to be expected
>
>
> product: PostgreSQL
> ver: 7.2.2
> driver: 7.1
> driver name: PostgreSQL Native Driver
>
> e: java.sql.SQLException: ERROR: No such attribute or function 'oid' at
> java.lang.Throwable.(Throwable.java:96)
> at java.lang.Exception.(Exception.java:44)
> at java.sql.SQLException.(SQLException.java:84)
> at org.postgresql.Connection.ExecSQL(Connection.java:533)
> at org.postgresql.Connection.ExecSQL(Connection.java:400)
> at org.postgresql.jdbc2.DatabaseMetaData.getColumns(DatabaseMetaData.java:1894)
> at JdbcTools.dumpMetaData(JdbcTools.java:86)
> at ReportRH.autoBtn_rawSqlFrm_DumpMetaData(ReportRH.java:343)
> at java.lang.reflect.Method.invoke(Native Method)
> at AutoButtonEntryPointWrapper.go(AutoButtonEntryPointWrapper.java:31)
> at jsp__nln__preview_2ejsp._jspService(jsp__nln__preview_2ejsp.java:145)
> at org.gjt.jsp.HttpJspPageImpl.service(HttpJspPageImpl.java:75)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
> at org.gjt.jsp.JspServlet$Page.process(JspServlet.java:640)
> at org.gjt.jsp.JspServlet.service(JspServlet.java:284)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
> at org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)
> at org.apache.jserv.JServConnection.run(JServConnection.java:188)
> at java.lang.Thread.run(Thread.java:498)
>
>
>
> Dave Cramer wrote:
>
> > Harrison,
> >
> > Sorry, I actually mis-read your first message, and thought that you said
> > that it was invalid. So were left with two possibilities.
> >
> > 1) The classpath is wrong?
> > 2) The source is wrong?
> >
> > Neither of these are likely since you have it working with another jar;
> > however something must be up?
> >
> > can you send me the relavent lines of code which you are using to load
> > the Driver?
> >
> > Dave
> > On Fri, 2002-08-30 at 15:26, Harrison wrote:
> > > I used NS 4.7 to down load the following:
> > > http://jdbc.postgresql.org/download/pgjdbc2.jar
> > >
> > > And compared it to the one installed by the Postgres 7.2.2 RPM
> > >
> > > They match
> > >
> > > Harrison
> > >
> > >
> > >
> > > Dave Cramer wrote:
> > >
> > > > If the jar is invalid, then it simply isn't going to work. How are you
> > > > downloading the jar?
> > > > On Thu, 2002-08-29 at 19:50, Harrison wrote:
> > > > > I am trying to upgrade a working application from Postgres 7.0 to 7.2.
> > > > >
> > > > > I have downloaded the pgjdbc2.jar and installed it next to the old jar.
> > > > >
> > > > > When I try to run with the new jar, I get a class not found exception:
> > > > > org.postgresql.Driver, when I switch the path back to the old driver I
> > > > > don't have this problem (but do have others due to the mismatch between
> > > > > the jdbc jar version, and thet Postgres version.)
> > > > >
> > > > > I have tried to look into the jar with three different jar/zip viewers,
> > > > > none of which seem to think pgjdbc2.jar is in a valid zip/jar format.
> > > > > The viewers are not the latest, but they have all looked inside other
> > > > > jars in the past. I have downloaded the jar twice and they compare ok.
> > > > >
> > > > > I get the same Class not found with the older /pg72/jdbc7.1-1.2.jar as
> > > > > well.
> > > > >
> > > > > The jdbc7.1-1.2.jar is the one that works. (For the Class not found
> > > > > part)
> > > > >
> > > > > I am running RH Linux 7.2, Apache 1.3.14 ApacheJServ/1.1.2/ GNUJSP 1.0
> > > > > wrapper (yes I know, long in the tooth, but they were to be upgraded
> > > > > after the Postgres upgrade.)
> > > > >
> > > > > We are using the IBM JVM 2-13 which I believe is a Java 1.3 VM (I'm not
> > > > > sure if the JIT compiler is enabled)
> > > > >
> > > > > Any thoughts would be most welcome.
> > > > >
> > > > > Harrison
> > > > >
> > > > > huhl(at)email-services(dot)net
> > > > >
> > > > >
> > > > > ---------------------------(end of broadcast)---------------------------
> > > > > TIP 3: if posting/reading through Usenet, please send an appropriate
> > > > > subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> > > > > message can get through to the mailing list cleanly
> > > > >
> > > > >
> > >
> > >
>
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Ahmed Huwait 2002-08-31 01:08:19 A JDBC driver problem
Previous Message Harrison 2002-08-30 22:35:24 Re: 7.0 - 7.2 upgrade, org.postgresql.Driver Class not found