-->
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.  [ 4 posts ] 
Author Message
 Post subject: Serialize object
PostPosted: Sat Aug 25, 2007 12:21 pm 
Beginner
Beginner

Joined: Sun Aug 12, 2007 11:22 am
Posts: 44
Location: Sweden
What are the steps to get my Hibernated web application serialize object to my applet?

When I try I get , java.io.InvalidClassException: org.hibernate.AbstractPersistentCollection; local class incompatible.


Top
 Profile  
 
 Post subject: implements
PostPosted: Sun Aug 26, 2007 8:00 am 
Newbie

Joined: Mon Aug 20, 2007 5:18 am
Posts: 8
did u implement your persistent class from Serializable interface?

such as
public class Class name implements Serializable


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 26, 2007 8:46 am 
Beginner
Beginner

Joined: Sun Aug 12, 2007 11:22 am
Posts: 44
Location: Sweden
Yes all my annotated dto's implements Serializable.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 26, 2007 1:58 pm 
Beginner
Beginner

Joined: Sun Aug 12, 2007 11:22 am
Posts: 44
Location: Sweden
Maybe I'm missing someting here.

I have Hibernate annotated DTO's that I persist in the database. I want to serialize thoose to an applet via servlet.

What is your approach to this. Must I create other dto that are not annotated for serialization?

ex. This is sudo code and will of corse not work.

Applet
Code:
Product prod = new Product( "test" );
ObjectOutputStream.writeObject ( prod );

// get new object from servlet here


Servlet
Code:
Product product = ( Product )ObjectInputstream.readObject();
Product newProduct = ProdDaO.findUnique( product );


// Write to applet.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.