-->
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: Issue with serialization going from beta 5 to beta 6
PostPosted: Wed Nov 16, 2005 11:00 am 
Newbie

Joined: Mon Oct 25, 2004 9:18 am
Posts: 7
Upgrading from beta 5 to beta 6 of the annotations I've started to get a very strange error when trying to use Map associations.

Given a property annotated like this:

Code:
@OneToMany(mappedBy = "category")
@MapKey(name = "translationLanguage")
@Where(clause = "tablename='CATEGORY' and status&1=1")
private Map<Language, CategoryTranslation> translations;


I get a very strange error about serialization.

Code:
Invocation of method 'getTranslationText' in  class com.initech.system.model.Category
threw exception class org.hibernate.type.SerializationException : could not deserialize


then followed by this error

Code:
2005-11-16 14:22:02,826 ERROR [org.hibernate.LazyInitializationException] Host: 192.168.200.128 - illegal access to loading collection
org.hibernate.LazyInitializationException: illegal access to loading collection
        at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:340)
        at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:85)
        at org.hibernate.collection.AbstractPersistentCollection.readElementByIndex(AbstractPersistentCollection.java:160)
        at org.hibernate.collection.PersistentMap.get(PersistentMap.java:127)
        at com.initech.system.model.Category.getTranslationText(Category.java:231)


This particular mapping works fine in Annotations 3.1 beta 5, but as soon as you use beta 6, the serialization error occurs.

I'll see if I can distill it down to a simple unit test as I can't paste the code in wholesale. I'd look at the differences in CVS between the releases, but sourceforge CVS is down at the moment.


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.