Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id EFD0E9FB6A6 for ; Mon, 19 Feb 2007 14:37:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 36747-02 for ; Mon, 19 Feb 2007 14:37:05 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id 33F679FB7DB for ; Mon, 19 Feb 2007 14:37:05 -0400 (AST) Received: (qmail 1884 invoked by uid 1112); 19 Feb 2007 18:37:04 -0000 Date: Mon, 19 Feb 2007 13:37:04 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: matrixx cc: pgsql-jdbc@postgresql.org Subject: Re: NPE in BlobInputStream In-Reply-To: Message-ID: References: <45674071.1060509@freenet.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/100 X-Sequence-Number: 16656 On Sun, 26 Nov 2006, Kris Jurka wrote: > On Fri, 24 Nov 2006, matrixx wrote: > >> im using the postgresql-8.1-407.jdbc3.jar driver over hibernate 3 to access >> databases. >> >> Our application currently runs with mysql and mssql drivers without any >> problems. With the postgresql driver i get the following exception: >> >> [ModuleProfile.deserialize@AWT-EventQueue-0] ERROR: Error deserializing >> blob. >> java.lang.NullPointerException >> at >> org.postgresql.largeobject.BlobInputStream.close(BlobInputStream.java:115) >> at java.beans.XMLDecoder.close(XMLDecoder.java:152) >> ... >> >> I dont know if its a driver bug, or a hibernate issue. >> > > It's a driver bug that's caused by one of two possible issues. It's > impossible to tell which from this stacktrace alone. > > 1) The BlobInputStream is violating the contract of the close method that > allows you to call it more than once. > > 2) You've called getInputStream more than once on a Blob and it can't handle > two streams simultaneously. > I've applied a more complete fix for these issues to CVS HEAD. Kris Jurka