Thread: Upgrading is a pain: JDBC Driver loading problems

Upgrading is a pain: JDBC Driver loading problems

From
Michael Pede
Date:
Okay, I've just upgraded to PostgreSQL 7.1.3 and java version
"1.1.8".  I'm trying to load the JDBC driver with both
Class.forName("postgresql.Driver") and
Class.forName("org.postgresql.Driver").  I get errors each time.

I have my CLASSPATH set up correctly.

For "postgresql.Driver" I get a ClassNotFoundException

For "org.postgresql.Driver" I get a NoClassDefFoundError, or more specifically
java.lang.NoClassDefFoundError: java/util/ArrayList
         at org.postgresql.core.ConnectionHook.<init>(Unknown Source)
         at
         at
         at test.main(test.java:11)

Perhaps my postgresql.jar is corrupt, but it's the one that Debian
installed, I haven't touched it.

Any and all help is greatly appreciated.

Michael Pede
mpede@sfu.ca

Re: Upgrading is a pain: JDBC Driver loading problems

From
"Dave Cramer"
Date:
Michael,

Yes, that definitely is a problem. Is there any chance you can upgrade
to jdk 1.2, or 1.3.
I will fix the problem shortly.

Dave

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Michael Pede
Sent: November 1, 2001 2:36 PM
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] Upgrading is a pain: JDBC Driver loading problems


Okay, I've just upgraded to PostgreSQL 7.1.3 and java version
"1.1.8".  I'm trying to load the JDBC driver with both
Class.forName("postgresql.Driver") and
Class.forName("org.postgresql.Driver").  I get errors each time.

I have my CLASSPATH set up correctly.

For "postgresql.Driver" I get a ClassNotFoundException

For "org.postgresql.Driver" I get a NoClassDefFoundError, or more
specifically
java.lang.NoClassDefFoundError: java/util/ArrayList
         at org.postgresql.core.ConnectionHook.<init>(Unknown Source)
         at
         at
         at test.main(test.java:11)

Perhaps my postgresql.jar is corrupt, but it's the one that Debian
installed, I haven't touched it.

Any and all help is greatly appreciated.

Michael Pede
mpede@sfu.ca

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org



Re: Upgrading is a pain: JDBC Driver loading problems

From
Antonio Fiol Bonnín
Date:
Michael,

You are probably trying to use a driver compiled for Java 2. You shouls use one
for Java version 1.1. One is available at http://jdbc.fastcrypt.com . Maybe there
are others. I am not a maintainer.

org.postgresql.Driver is the good one.

Antonio

Michael Pede wrote:

> Okay, I've just upgraded to PostgreSQL 7.1.3 and java version
> "1.1.8".  I'm trying to load the JDBC driver with both
> Class.forName("postgresql.Driver") and
> Class.forName("org.postgresql.Driver").  I get errors each time.
>
> I have my CLASSPATH set up correctly.
>
> For "postgresql.Driver" I get a ClassNotFoundException
>
> For "org.postgresql.Driver" I get a NoClassDefFoundError, or more specifically
> java.lang.NoClassDefFoundError: java/util/ArrayList
>          at org.postgresql.core.ConnectionHook.<init>(Unknown Source)
>          at
>          at
>          at test.main(test.java:11)
>
> Perhaps my postgresql.jar is corrupt, but it's the one that Debian
> installed, I haven't touched it.
>
> Any and all help is greatly appreciated.
>
> Michael Pede
> mpede@sfu.ca
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org


Re: Upgrading is a pain: JDBC Driver loading problems

From
"Nick Fankhauser"
Date:
Michael-

> For "org.postgresql.Driver" I get a NoClassDefFoundError, or more
> specifically
> java.lang.NoClassDefFoundError: java/util/ArrayList
>          at org.postgresql.core.ConnectionHook.<init>(Unknown Source)

This error sounds related to the java install. I'd guess that the postgres
part of the upgrade went fine. What java package did you install?

-Nick

--------------------------------------------------------------------------
Nick Fankhauser  nickf@ontko.com  Phone 1.765.935.4283  Fax 1.765.962.9788
Ray Ontko & Co.     Software Consulting Services     http://www.ontko.com/


Re: Upgrading is a pain: JDBC Driver loading problems

From
Stefano Reksten
Date:
At 10.07 05/11/01 -0500, you wrote:
>Michael-
>
> > For "org.postgresql.Driver" I get a NoClassDefFoundError, or more
> > specifically
> > java.lang.NoClassDefFoundError: java/util/ArrayList
> >          at org.postgresql.core.ConnectionHook.<init>(Unknown Source)
>
>This error sounds related to the java install. I'd guess that the postgres
>part of the upgrade went fine. What java package did you install?
>
>-Nick

The problem lies in Michael's JDK. Having only 1.1.8 he doen't have the
ArrayList class (substitute, although not synchronized, for java.util.Vector).

Ciao,
         Stefano



Re: Upgrading is a pain: JDBC Driver loading problems

From
Rene Pijlman
Date:
On Thu, 1 Nov 2001 11:35:53 -0800, you wrote:
>Okay, I've just upgraded to PostgreSQL 7.1.3 and java version
>"1.1.8".
[...]
>For "org.postgresql.Driver" I get a NoClassDefFoundError, or more specifically
>java.lang.NoClassDefFoundError: java/util/ArrayList

My guess is you're trying to use a driver built for a 1.2 JVM
with a 1.1 JVM. Try the JDK1.1.x driver from
http://jdbc.postgresql.org/download.html

Regards,
René Pijlman <rene@lab.applinet.nl>

Re: Upgrading is a pain: JDBC Driver loading problems

From
Barry Lind
Date:
Michael,

org.postgresql.Driver is the correct one to be loading.  It looks like
you are trying to use a 1.2 based driver with a 1.1 JVM.  The class
ArrayList is a 1.2 class.  If you use the correct jar file this should
work for you.

thanks,
--Barry


Michael Pede wrote:

> Okay, I've just upgraded to PostgreSQL 7.1.3 and java version "1.1.8".
> I'm trying to load the JDBC driver with both
> Class.forName("postgresql.Driver") and
> Class.forName("org.postgresql.Driver").  I get errors each time.
>
> I have my CLASSPATH set up correctly.
>
> For "postgresql.Driver" I get a ClassNotFoundException
>
> For "org.postgresql.Driver" I get a NoClassDefFoundError, or more
> specifically
> java.lang.NoClassDefFoundError: java/util/ArrayList
>         at org.postgresql.core.ConnectionHook.<init>(Unknown Source)
>         at
>         at
>         at test.main(test.java:11)
>
> Perhaps my postgresql.jar is corrupt, but it's the one that Debian
> installed, I haven't touched it.
>
> Any and all help is greatly appreciated.
>
> Michael Pede
> mpede@sfu.ca
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>



Re: Upgrading is a pain: JDBC Driver loading problems

From
"Nick Fankhauser"
Date:
> The problem lies in Michael's JDK. Having only 1.1.8 he doen't have the
> ArrayList class (substitute, although not synchronized, for
> java.util.Vector).

Ah! makes sense. So if he downloads this driver instead, he should be back
in business:

http://jdbc.postgresql.org/download/jdbc7.1-1.1.jar

-Nick