-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Hibernate 2.1.6 + Firebird 1.5.1 NullPointer
PostPosted: Fri Sep 24, 2004 9:42 am 
Newbie

Joined: Wed Sep 17, 2003 5:15 am
Posts: 9
Hibernate version:
Hibernate 2.1.6

Full stack trace of any exception that occurs:

Name and version of the database you are using:

Firebird 1.5.1 + JayBird JDBC driver 1.5.1 for JDK 1.4



Here is the hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"

"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="connection.username">sysdba</property>
<property name="connection.password">masterkey</property>
<property name="connection.url">jdbc:firebirdsql://127.0.0.1/c:/db/forum.gdb</property>
<property name="connection.driver_class">org.firebirdsql.jdbc.FBDriver</property>
<property name="dialect">net.sf.hibernate.dialect.FirebirdDialect</property>

<mapping resource="....................."
</session-factory>
</hibernate-configuration>



, ok i have following exception:
2004-09-24 17:30:36,850: ERROR [net.sf.hibernate.collection.PersistentCollection] Failed to lazily initialize a collection
java.lang.NullPointerException: charsetName
at java.io.InputStreamReader.<init>(InputStreamReader.java:82)
at org.firebirdsql.jdbc.field.FBField.getCharacterStream(FBField.java:603)
at org.firebirdsql.jdbc.FBResultSet.getCharacterStream(FBResultSet.java:754)
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:611)
at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:552)
at net.sf.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:511)
at net.sf.hibernate.loader.Loader.getRow(Loader.java:426)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:209)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:915)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:890)
at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:93)
at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:284)
at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3264)
at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:195)
at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71)
at net.sf.hibernate.collection.Bag.iterator(Bag.java:256)
at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:302)
at org.apache.jsp.messagelist_jsp._jspService(messagelist_jsp.java:158)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)




did i missed something with Firebird configuration?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 24, 2004 10:35 am 
Newbie

Joined: Wed Sep 17, 2003 5:15 am
Posts: 9
i isolate the problem.

This exception, concerning charSet appears only when we are using "text" mapping . Hibernate 2.1.6 generate BLOB type 1 for Firebird.

May be there are some problem with huge text type on Firebird?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 11, 2004 9:19 pm 
Regular
Regular

Joined: Tue Oct 12, 2004 9:02 am
Posts: 66
Location: Italy
I have the same problem with firebird 1.5.
I think i can't use blob field.
That is a big problem!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 12, 2004 6:23 am 
Newbie

Joined: Wed Sep 17, 2003 5:15 am
Posts: 9
i've solved this problem by rewriting JetBird driver, so it uses only my custom enconding, and therefore, no NullPoiterException can occur.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 27, 2006 11:16 am 
Newbie

Joined: Mon Mar 27, 2006 11:05 am
Posts: 2
Hi!

i have the same problem today and here my solution:

A much better fix for this problem is to set the encoding property for Firebird/Jaybird:

Code:
<property name="connection.encoding">UNICODE_FSS</property>


Put it in your hibernate.cfg.xml / hibernate.properties

Now works the text-mapping with firebird blob sub_type 1

greetings
Sergius


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 2:24 am 
Newbie

Joined: Mon Mar 27, 2006 11:05 am
Posts: 2
OK, my solution was not perfect :(

The Nullpointer was fixed in the newest JayBird driver 2.0.1, this is the best solution!
Driver 1.5.6 has the same bug.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.