Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id AE31363347F for ; Wed, 11 Mar 2009 11:33:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 96976-02 for ; Wed, 11 Mar 2009 11:33:30 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id 0071363340F for ; Wed, 11 Mar 2009 11:33:32 -0300 (ADT) Received: from 219-89-241-75.adsl.xtra.co.nz ([219.89.241.75] helo=[192.168.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1LhPUs-0008MS-L5; Thu, 12 Mar 2009 03:33:26 +1300 Message-ID: <49B7CBB6.5020800@opencloud.com> Date: Thu, 12 Mar 2009 03:33:26 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Peter CC: pgsql-jdbc@postgresql.org Subject: Re: Totally weird behaviour in org.postgresql.Driver References: <49b7bfef$0$1343$834e42db@reader.greatnowhere.com> In-Reply-To: <49b7bfef$0$1343$834e42db@reader.greatnowhere.com> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/56 X-Sequence-Number: 19386 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