-->
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: getting SerializationException: could not deserialize
PostPosted: Mon Aug 30, 2004 11:22 am 
Newbie

Joined: Mon Aug 30, 2004 10:07 am
Posts: 1
I am getting following error though my IData and other objects are Serializable.

Hibernate version:



2.1

Mapping documents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping default-cascade="none" default-access="property" auto-import="true">
<class name="com.aa.bb.cc.IData" table="INV" mutable="true"
polymorphism="implicit" dynamic-update="false" dynamic-insert="false" batch-size="1"
select-before-update="false" optimistic-lock="version">
<composite-id name="id" class="com.aa.bb.cc.InvoicePK" unsaved-value="none">
<key-property name="invId" column="INV_ID" type="integer" />
</composite-id>

<component name="shipperId" class="com.logistics.javalib.domain.id.ShipperId">
<property name="shipperId" column="TC_COMPANY_ID"/>
</component>
<component name="tcInvoiceId" class="com.aa.bb.cc.MaxLengthString">
<property name="stringValue" column="INVOICE_ID"/>
</component>
<property column="INVOICE_STATUS" length="5" name="invStatus" type="short"/>
</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():

Session session1 = OFRDef.openSession ();
ArrayList all = null;
try
{
Object[] vals = new Object[]
{
new Integer (101),
};
List list = session1.find ("from IData d where" +
" d.id.invId = ?",
vals,
new Type[] {Type.INTEGER});
if (list == null)
{
all = new ArrayList (0);
}
else
{
all = new ArrayList (list);
}
}
catch (PersistLayerException ex)
{
ex.printStackTrace();
throw ex;
}
finally
{
session1.close ();
}

Full stack trace of any exception that occurs:

net.sf.hibernate.type.SerializationException: could not deserialize
at com.aa.bb.cc.layer.SessionImpl.find(SessionImpl.java:675)
at webroot.jsp_servlet._aa._bb._cc._jsp.__IDetails._jspService(__IDetails.java:720)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1058)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:401)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:20)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5451)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:780)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3105)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2588)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
Caused by: net.sf.hibernate.type.SerializationException: could not deserialize
at net.sf.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:197)
at net.sf.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:220)
at net.sf.hibernate.type.SerializableType.fromBytes(SerializableType.java:73)
at net.sf.hibernate.type.SerializableType.get(SerializableType.java:38)
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.type.ComponentType.hydrate(ComponentType.java:387)
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.doList(Loader.java:955)
at net.sf.hibernate.loader.Loader.list(Loader.java:946)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:846)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1543)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1520)
at com.aa.bb.cc.layer.SessionImpl.find(SessionImpl.java:671)
... 12 more
Caused by: java.io.StreamCorruptedException: InputStream does not contain a serialized object
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:844)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:163)
at net.sf.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:189)
... 31 more

Name and version of the database you are using:

Oracle 9i

Debug level Hibernate log excerpt:

_________________
Santosh Kumar


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.