Re: Totally weird behaviour in org.postgresql.Driver - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Totally weird behaviour in org.postgresql.Driver
Date
Msg-id 49B7CBB6.5020800@opencloud.com
Whole thread Raw
In response to Totally weird behaviour in org.postgresql.Driver  ("Peter" <peter@greatnowhere.com>)
List pgsql-jdbc
Peter wrote:
> My app used to work fine until I started getting tons of
> NullPointerExceptions in org.postgresql.Driver:586
>
> for (int tmp = 0;tmp < protocols.length;tmp++)
> I traced into that line and 'protocols' variable is null. That variable is
> private static, and is not being assigned to anywhere outside the
> constructor (why isnt it 'final'?).

Yes, it should probably be private static final. (that code is pretty
ugly, anyway)

> I'm totally at loss why and how
> protocols can become null. JVM bug perhaps? This is Tomcat 6 running on
> Ubuntu 8.10, and my webapp uses BlazeDS.
>
> Any ideas? Could this be due to improper synchronization somewhere in my
> app?

It does sound like a JVM bug.

If you're using gcj (might be the default on an Ubuntu install, I don't
remember), throw it away; every time I've seen "impossible" NPEs like
this it's been because of gcj bugs.

-O

pgsql-jdbc by date:

Previous
From: "Peter"
Date:
Subject: Totally weird behaviour in org.postgresql.Driver
Next
From: "Peter"
Date:
Subject: Re: Totally weird behaviour in org.postgresql.Driver