Security manager changing the jdbc Connection class?

Поиск
Список
Период
Сортировка
От Rich Cullingford
Тема Security manager changing the jdbc Connection class?
Дата
Msg-id 3E22F56F.7080904@sysd.com
обсуждение исходный текст
Ответы Re: Security manager changing the jdbc Connection class?  (Barry Lind <blind@xythos.com>)
Список pgsql-jdbc
All,
This bizarre behaviour occurs after I compile the jdbc jar from source
(/usr/local/java/jdk->j2sdk1.4.1, 'configure' & 'gmake' build a JDBC3
edition driver). I placed 'postgresql.jar' in /usr/local/java/lib, which
is in CLASSPATH.

The server has been set up to receive TCP/IP connections. Now I compile
and run basic.java in the 'examples' directory, and (with debug 'on') get:

[rculling@thriller example]$ java basic jdbc:postgresql:rculling rcu
ng debug
PostgreSQL basic test v6.3 rev 1

DriverManager.initialize: jdbc.drivers = null
JDBC DriverManager initialized
registerDriver: driver[className=org.postgresql.Driver,org.postgresq
2e08]
Connecting to Database URL = jdbc:postgresql:rculling
DriverManager.getConnection("jdbc:postgresql:rculling")
     trying driver[className=org.postgresql.Driver,org.postgresql.Dri
Exception in thread "main" java.lang.NoClassDefFoundError: org/postg
AbstractJdbc2Connection
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
         at java.security.SecureClassLoader.defineClass(SecureClassLo
3)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:2
         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:
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
         at java.security.SecureClassLoader.defineClass(SecureClassLo
3)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:2
         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:
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
         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:5
         at java.sql.DriverManager.getConnection(DriverManager.java:1
         at basic.<init>(basic.java:37)
         at basic.main(basic.java:212)

The relevant source line in org.postgresql.Driver.connect says it's
attempting a Class.forName("org.postgresql.jdbc3.Jdbc3Connection"), but
by the time the error registers, the system seems to be attempting to
load "org.postgres.jdbc2.AbstractJdbc2Cnnection."  The jar file has an
AbstractJdbc3Connection, but not Jdbc2. Is something funny happening in
the do.Privileged() calls by the SecurityManager?

I'm stumped. Thanks for any help.
                               Rich Cullingford





В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Charles H. Woloszynski"
Дата:
Сообщение: Re: [PERFORM] join over 12 tables takes 3 secs to plan
Следующее
От: Barry Lind
Дата:
Сообщение: Re: Security manager changing the jdbc Connection class?