Subject Me Too - Re: Text blob NullPointerException
Author Jeff Roberts
I am seeing this exact problem. We are using Hibernate 3 with
JayBird 1.5.5 and as stated, you can write to a BLOB but not read.

I re-tried today with the 2.0.0 RC1 driver and with that version I
now get a similar exception in *Output*StreamWriter when I first try
to WRITE to the BLOB.

Both InputStreamReader and OutputStreamWriter appear to have a
constructor that accepts no charset and "uses the default charset".
Is there a known problem? Is there a way to specify a character set
that I'm not aware of, and if so, can it be done via Hibernate or a
setting on the datasource?

-Jeff

--- In Firebird-Java@yahoogroups.com, Grzegorz Kowal
<grzegorz_7_7@o...> wrote:
>
> Hi,
>
> JayBird 1.5.5 causes a NPE when reading a text blob on Windows, but
> everything is ok on Linux. Version 1.01 works fine on both systems.
> Same issue: http://groups.yahoo.com/group/Firebird-
Java/message/7080
>
> java.lang.NullPointerException: charsetName
> at java.io.InputStreamReader.<init>(Unknown Source)
> at
> org.firebirdsql.jdbc.field.TranslatingReader.<init>
(TranslatingReader.java:79)
> at
> org.firebirdsql.jdbc.field.TranslatingReader.getInstance
(TranslatingReader.java:54)
> at
> org.firebirdsql.jdbc.field.FBField.getCharacterStream
(FBField.java:604)
> at
> org.firebirdsql.jdbc.FBResultSet.getCharacterStream
(FBResultSet.java:754)
> at
> org.apache.commons.dbcp.DelegatingResultSet.getCharacterStream
(DelegatingResultSet.java:298)
> at
> org.apache.commons.dbcp.DelegatingResultSet.getCharacterStream
(DelegatingResultSet.java:298)
> at net.sf.hibernate.type.TextType.get(TextType.java:29)
> at net.sf.hibernate.type.NullableType.nullSafeGet
(NullableType.java:62)
> at net.sf.hibernate.type.NullableType.nullSafeGet
(NullableType.java:53)
> at net.sf.hibernate.type.AbstractType.hydrate
(AbstractType.java:66)
> at net.sf.hibernate.loader.Loader.hydrate(Loader.java:686)
> at net.sf.hibernate.loader.Loader.loadFromResultSet
(Loader.java:627)
> at net.sf.hibernate.loader.Loader.instanceNotYetLoaded
(Loader.java:586)
> at net.sf.hibernate.loader.Loader.getRow(Loader.java:501)
> at net.sf.hibernate.loader.Loader.getRowFromResultSet
(Loader.java:213)
> at net.sf.hibernate.loader.Loader.doQuery(Loader.java:281)
> at
>
net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections
(Loader.java:133)
> at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
> at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
> at net.sf.hibernate.hql.QueryTranslator.list
(QueryTranslator.java:854)
> at net.sf.hibernate.impl.SessionImpl.find
(SessionImpl.java:1544)
> at net.sf.hibernate.impl.SessionImpl.find
(SessionImpl.java:1521)
> at net.sf.hibernate.impl.SessionImpl.find
(SessionImpl.java:1513)
>
> CREATE TABLE "SH_SKRYPTY"
> (
> "UID" NUMERIC(18, 0) NOT NULL,
> "VERSION" INTEGER NOT NULL,
> "SID" VARCHAR(80) CHARACTER SET WIN1250 COLLATE PXW_PLK,
> "VTYPE" INTEGER,
> "VTEXT" BLOB SUB_TYPE TEXT SEGMENT SIZE 80 CHARACTER SET
WIN1250,
> PRIMARY KEY ("UID")
> );
>
> Windows Xp Pro SP2, Firebird 1.5.2
> JayBird 1.5.5
> Hibernate 2.1.8
> JRE version 1.4.2_06 / 1.5.0_01
>
>
> Thanks,
> Grzegorz