aspose file tools*
The moose likes Object Relational Mapping and the fly likes SerializationException: could not deserialize Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "SerializationException: could not deserialize" Watch "SerializationException: could not deserialize" New topic
Author

SerializationException: could not deserialize

David Mob
Greenhorn

Joined: Oct 25, 2010
Posts: 5
i have a table defined as...


reverse engineering it via Hibernate i get the following...(setters omitted for brevity)


when i call my Dao object's "FindAll()" i get...


i have tried commenting out the Set (obdElements), but get the same results. i have tried remapping *by hand* PARENT_OBD_ELEMENT_ID to be a Long parentObdElementId instead of an instance of ObdElement...still no go. i've actually always had good luck with reverse engineering tables...until now. i noticed that the NOT NULL columns are mapped to "long", and the nullable columns (that contain Ids) are mapped to "Long". any ideas? i'll keep looking 'round the web for ideas.

thanks....
David Mob
Greenhorn

Joined: Oct 25, 2010
Posts: 5
i was finally able to identify the problematic column...."parent_obd_element_id". when i removed it from the table, and remapped the class i was able to run "findAll()" successfully. now the big question: why? that column is, of course, the parent element_id of a given row. whether it maps as a Long parentObdElementId or as an instance of the class ObdElement obdElement doesn't seem to matter (in both cases i get the exception).
David Mob
Greenhorn

Joined: Oct 25, 2010
Posts: 5
i guess i should show you how ParentObdElementId works....

Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Good work, greenhorn!

Sometimes it feels like you're having a conversation with yourself, but it's great when you solve a problem and actually post back the solution. You'd be amazed by how many other people in the community you'll be helping who have the exact same problem. Thumbs up!

-Cameron McKenzie
David Mob
Greenhorn

Joined: Oct 25, 2010
Posts: 5
well...all i did was identify the "bad" column. i don't actually have a fix (yet?!?). but i do appreciate your enthusiasm that i *will* solve it.
David Mob
Greenhorn

Joined: Oct 25, 2010
Posts: 5
SOLVED!

i hadn't noticed until today but a TIMESTAMP field in the table was reverse generated into....

private Serializable lastActUpDateTime;

that looked odd, so i change it to...

private java.util.Date lastActUpDateTime;

and my problem went away.
Jayesh Mahato
Greenhorn

Joined: Jun 24, 2011
Posts: 17
Hi,

I am suffering from the same problem. I have changed all serializable values to date type, but i now get the error: could not execute query. The data types now in the hibernate generated class files are: BigDecimal, String, Date.

Kindly help me to solve the problem. The stack trace is given below:

 
Don't get me started about those stupid light bulbs.
 
subject: SerializationException: could not deserialize