-->
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.  [ 1 post ] 
Author Message
 Post subject: SerializationException during deserialization with Oracle
PostPosted: Mon Apr 25, 2005 3:30 am 
Newbie

Joined: Mon Apr 25, 2005 2:57 am
Posts: 1
Hi,

I am receiving a SerializationException (during deserialization) when trying to load an object in Hibernate 3.0.1. I am using Oracle 10g. The class I have is very simple:

Code:
public class ResourceAttribute {

  private String name;
  private String value;
  private Serializable data;

...

  public Serializable getData() { return data; }
  public void setData(Serializable data) { this.data = data; }
}


and the mapping for it:

Code:
  <class
    name="ResourceAttribute"
    table="resource_attribute">
    <id name="id" type="integer">
      <generator class="sequence">
        <param name="sequence">resource_attribute_seq</param>
      </generator>
    </id>
    <property name="name"/>
    <property name="value"/>
    <property name="data" type="serializable"/>
  </class>


right now I am just testing, so I successfully have an Integer object committed to the database:

Code:
        ResourceAttribute ra = new ResourceAttribute();
        ra.setData(new Integer(613));


Using SQL*Plus, I verify that the insert was successful (I can't view the data column however, its a BLOB)

So, apparently serialization is successful, its just when Hibernate tries to deserialize that I get the error.

The stack trace is listed below.

I have set use_streams_for_binary for true, and batch_size to 0, according to suggestions from other posts on this forum.

Any help is greatly appreciated!

David

Code:
Hit uncaught exception org.hibernate.type.SerializationException
org.hibernate.type.SerializationException: could not deserialize

   at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:211)

   at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:234)

   at org.hibernate.type.SerializableType.fromBytes(SerializableType.java:78)

   at org.hibernate.type.SerializableType.get(SerializableType.java:39)

   at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:77)

   at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:68)

   at org.hibernate.type.AbstractType.hydrate(AbstractType.java:80)

   at org.hibernate.persister.entity.BasicEntityPersister.hydrate(BasicEntityPersister.java:1699)

   at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:925)

   at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:876)

   at org.hibernate.loader.Loader.getRow(Loader.java:789)

   at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:295)

   at org.hibernate.loader.Loader.doQuery(Loader.java:389)

   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:208)

   at org.hibernate.loader.Loader.loadCollection(Loader.java:1367)

   at org.hibernate.loader.collection.OneToManyLoader.initialize(OneToManyLoader.java:107)

   at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:488)

   at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)

   at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1356)

   at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:171)

   at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:48)

   at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:134)

   at edu.baylor.csi4335.HibernateUtil.main(HibernateUtil.java:53)

Caused by: java.io.StreamCorruptedException: invalid stream header

   at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:737)

   at java.io.ObjectInputStream.<init>(ObjectInputStream.java:253)

   at org.hibernate.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:246)

   at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:203)

   ... 22 more



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

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.