/ Forside / Teknologi / Udvikling / SQL / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
SQL
#NavnPoint
pmbruun 1704
niller 962
fehaar 730
Interkril.. 701
ellebye 510
pawel 510
rpje 405
pete 350
gibson 320
10  smorch 260
jre1.4.1_01 missing postgres driver.
Fra : Glenn Ivar Klausen


Dato : 15-01-03 14:11


We are using a postgres database, and are forced to use jre because the
org.postgres.Driver class is not included in the jre1.4.1_01 rt.jar.

I've extracted all the class files under org/postgres/* (se list at the
bottom) to a own .jar file and include that in the classpath, but the
call to Class.forName("org.postgresql.Driver"); fails with this exception:

What must I do to get my database to work with jre1.4.1_01 and newer
versions?

==========
java.lang.NoClassDefFoundError: org/postgresql/Connection
   at java.lang.ClassLoader.defineClass0(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:140)
   at org.postgresql.Driver.connect(Driver.java:121)
   at java.sql.DriverManager.getConnection(DriverManager.java:512)
   at java.sql.DriverManager.getConnection(DriverManager.java:171)
   at no.zeroone.zoac.db.JZOACDatabase.connect(JZOACDatabase.java:190)
   at no.zeroone.zoac.ZOAC.<init>(ZOAC.java:100)
   at no.zeroone.zoac.ZOAC.main(ZOAC.java:436)
Exception in thread "main"
Process completed.
=============

Files included in postgres.jar
org/
org/postgresql/
org/postgresql/Connection.class
org/postgresql/core/
org/postgresql/core/BytePoolDim1.class
org/postgresql/core/BytePoolDim2.class
org/postgresql/core/ConnectionHook.class
org/postgresql/core/MemoryPool.class
org/postgresql/core/ObjectPool.class
org/postgresql/core/SimpleObjectPool.class
org/postgresql/Driver.class
org/postgresql/errors.properties
org/postgresql/errors_fr.properties
org/postgresql/errors_it.properties
org/postgresql/errors_nl.properties
org/postgresql/fastpath/
org/postgresql/fastpath/Fastpath.class
org/postgresql/fastpath/FastpathArg.class
org/postgresql/Field.class
org/postgresql/geometric/
org/postgresql/geometric/PGbox.class
org/postgresql/geometric/PGcircle.class
org/postgresql/geometric/PGline.class
org/postgresql/geometric/PGlseg.class
org/postgresql/geometric/PGpath.class
org/postgresql/geometric/PGpoint.class
org/postgresql/geometric/PGpolygon.class
org/postgresql/jdbc2/
org/postgresql/jdbc2/CallableStatement.class
org/postgresql/jdbc2/Connection.class
org/postgresql/jdbc2/DatabaseMetaData.class
org/postgresql/jdbc2/PreparedStatement.class
org/postgresql/jdbc2/ResultSet.class
org/postgresql/jdbc2/ResultSetMetaData.class
org/postgresql/jdbc2/Statement.class
org/postgresql/jdbc2/UpdateableResultSet.class
org/postgresql/largeobject/
org/postgresql/largeobject/BlobInputStream.class
org/postgresql/largeobject/BlobOutputStream.class
org/postgresql/largeobject/LargeObject.class
org/postgresql/largeobject/LargeObjectManager.class
org/postgresql/largeobject/PGblob.class
org/postgresql/largeobject/PGclob.class
org/postgresql/PG_Stream.class
org/postgresql/ResultSet.class
org/postgresql/Statement.class
org/postgresql/util/
org/postgresql/util/PGmoney.class
org/postgresql/util/PGobject.class
org/postgresql/util/PGtokenizer.class
org/postgresql/util/PSQLException.class
org/postgresql/util/Serialize.class
org/postgresql/util/UnixCrypt.class


Glenn


 
 
Nikolaj Hansen (20-01-2003)
Kommentar
Fra : Nikolaj Hansen


Dato : 20-01-03 14:17

You need to include the postgresql JDBC drivers in your classpath for
the Java 1.4.1 Virtual machine.

The jar file is a part of the disto package from postgresql.org

- Nikolaj


Søg
Reklame
Statistik
Spørgsmål : 177559
Tips : 31968
Nyheder : 719565
Indlæg : 6408938
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste