-->
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: Mysql deserialization Problem
PostPosted: Thu Oct 09, 2003 4:02 am 
Newbie

Joined: Wed Aug 27, 2003 3:09 am
Posts: 17
The problem:
When I try to deserialize SimpleClusteringResult javabean from mysql database, the below stack trace is resulted. The same problem is avoided by replacing MySQL with PostgreSQL 7.2.

Also, I have tried to load the serialized object with JDBC code. Such object can be loaded correctly from the database and can be deserialized without problem.Thus I am sure that the following problem is not related to the object size(17kbytes).

The configuration to reproduce the problem:
    Hibernate 2.0.2 and 2.0.3
    J2sdk 1.4.2
    mysql-connector-java-3.0.8-stable
    Mysql 3.x


The SimpleClusteringResult javabean:
Code:
public class SimpleClusteringResult implements Serializable {
   protected int[][] clusterMembers;
   protected int[][] selectedAttrs;
   protected int[] outliers;
}



Stack trace:
Code:
hk.hku.csis.biosphere.webservices.buffer.PersistenceException: net.sf.hibernate.type.SerializationException: Could not deserialize a serializable property:
   at hk.hku.csis.biosphere.webservices.buffer.DatabaseCompletedTaskBuffer.getCompletedTask(DatabaseCompletedTaskBuffer.java:82)
   at hk.hku.csis.biosphere.webservices.buffer.DatabaseCompletedTaskBuffer.main(DatabaseCompletedTaskBuffer.java:91)
Caused by: net.sf.hibernate.type.SerializationException: Could not deserialize a serializable property:
   at net.sf.hibernate.type.SerializableType.fromBytes(SerializableType.java:75)
   at net.sf.hibernate.type.SerializableType.get(SerializableType.java:35)
   at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:59)
   at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:51)
   at net.sf.hibernate.type.AbstractType.hydrate(AbstractType.java:66)
   at net.sf.hibernate.loader.Loader.hydrate(Loader.java:419)
   at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:373)
   at net.sf.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:342)
   at net.sf.hibernate.loader.Loader.getRow(Loader.java:281)
   at net.sf.hibernate.loader.Loader.doFind(Loader.java:159)
   at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:587)
   at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42)
   at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:396)
   at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1889)
   at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1757)
   at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1688)
   at hk.hku.csis.biosphere.webservices.buffer.DatabaseCompletedTaskBuffer.getCompletedTask(DatabaseCompletedTaskBuffer.java:74)
   ... 1 more
Caused by: org.apache.commons.lang.SerializationException
   at org.apache.commons.lang.SerializationUtils.deserialize(SerializationUtils.java:170)
   at org.apache.commons.lang.SerializationUtils.deserialize(SerializationUtils.java:191)
   at net.sf.hibernate.type.SerializableType.fromBytes(SerializableType.java:72)
   ... 17 more
Caused by: java.io.EOFException
   at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2165)
   at java.io.ObjectInputStream$BlockDataInputStream.readInts(ObjectInputStream.java:2786)
   at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1582)
   at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
   at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1603)
   at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
   at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
   at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
   at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
   at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
   at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
   at org.apache.commons.lang.SerializationUtils.deserialize(SerializationUtils.java:165)
   ... 19 more
Process terminated with exit code 0


Top
 Profile  
 
 Post subject: Same problem
PostPosted: Fri Oct 10, 2003 10:28 am 
Newbie

Joined: Fri Oct 10, 2003 10:14 am
Posts: 7
I'm seeing the excact same problem with Hibernate 2.0.1 HSQLDB 1.7.1. JDK 1.4.2_01, while retrieving an array of strings. I'm not sure this is really a hibernate error, seems more like an error in commons-lang since this is where the EOFException occurs.

What's strange is that if I store just a string (instead of an array of strings), I get a StreamCorruptedException in SerializationUtils instead. When looking at the data from an SQL client, everything looks good.

Any clues to help us out? :)

Cheers,

Dag


Top
 Profile  
 
 Post subject: Re: Same problem
PostPosted: Fri Oct 10, 2003 10:35 am 
Newbie

Joined: Fri Oct 10, 2003 10:14 am
Posts: 7
DaGGeRRz wrote:
I'm seeing the excact same problem with Hibernate 2.0.1 HSQLDB 1.7.1. JDK 1.4.2_01, while retrieving an array of strings.


Same problem with Hibernate 2.0.3 as well.


Top
 Profile  
 
 Post subject: My error seems to be in HSQLDB...
PostPosted: Fri Oct 10, 2003 10:52 am 
Newbie

Joined: Fri Oct 10, 2003 10:14 am
Posts: 7
...so sorry about bothering the Hibernate community. :)

Cheers,

Dag


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 21, 2003 4:44 pm 
Newbie

Joined: Tue Oct 21, 2003 4:31 pm
Posts: 1
I see the same traceback.
I am using Hibernate 2.03, MySQL 4.0.15
driver=org.gjt.mm.mysql.Driver
[tried com.mysql.jdbc.Driver, failed too]
this is within the context of Jboss 3.22.

my property is:
<property name="delegateBytes" column="INVOCATION" type="binary" length="1024" />

the property setter/getter in the Java object uses byte []
this property is mapped to a BLOB column in the table.

I also tried setter/getter that uses java.sql.Blob directly.
that did not throw an exception, but I could never retrieve
the data successfully after a persist. the blob always came back
empty.

In my example, the length of the byte array is over 255
but well under the 1024 limit.

_________________
Jim Daues
Tripos Inc


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 21, 2003 6:24 pm 
Newbie

Joined: Fri Oct 10, 2003 10:14 am
Posts: 7
JimDaues wrote:
I see the same traceback.
I am using Hibernate 2.03, MySQL 4.0.15
driver=org.gjt.mm.mysql.Driver
[tried com.mysql.jdbc.Driver, failed too]
this is within the context of Jboss 3.22.

my property is:
<property name="delegateBytes" column="INVOCATION" type="binary" length="1024" />

the property setter/getter in the Java object uses byte []
this property is mapped to a BLOB column in the table.

I also tried setter/getter that uses java.sql.Blob directly.
that did not throw an exception, but I could never retrieve
the data successfully after a persist. the blob always came back
empty.

In my example, the length of the byte array is over 255
but well under the 1024 limit.


Perhaps this is Hibernate, after all. I haven't really had time to do more research / debugging. In this specific instance - the binaries are all set and read by the same service and no other process touches it (+ low volume, so everything stays in cached in the session). This in combination with being far-from-critical makes it acceptable for us to wait for a HSQL or Hibernate fix, so we just haven't done anything about it yet.

Perhaps Gavin or one of the other contributors can comment?


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.