Re: 8.0 drivers released.

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: 8.0 drivers released.
Дата
Msg-id 41ED8B01.1010209@opencloud.com
обсуждение исходный текст
Ответ на Re: 8.0 drivers released.  (Oliver Jowett <oliver@opencloud.com>)
Ответы context classloader (was: Re: 8.0 drivers released.)
Список pgsql-jdbc
Oliver Jowett wrote:
> Andreas Joseph Krogh wrote:
>
>> NullPointerException:
>> Caused by: java.lang.NullPointerException
>>         at org.postgresql.Driver.getDefaultProperties(Driver.java:84)
>>         at org.postgresql.Driver.connect(Driver.java:167)
>>         at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:599)
>
> Driver.java:84 is:
>
> Enumeration urlEnum =
> getClass().getClassLoader().getResources("org/postgresql/driverconfig.properties");
>
> I guess that org.postgresql.Driver is being loaded by the bootstrap
> classloader (getClassLoader() returns null). How exactly are you getting
> the driver jar into the classpath?

I can reproduce the exception by running test code when the driver is
loaded from the bootstrap classpath
('-Xbootclasspath/a:jars/postgresql.jar')

It seems reasonable to fall back to the system classloader if the driver
was loaded from the bootstrap classloader. I will commit a change to do
this shortly.

-O

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Two bugs found (and patch included)
Следующее
От: Vadim Nasardinov
Дата:
Сообщение: context classloader (was: Re: 8.0 drivers released.)