-->
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.  [ 3 posts ] 
Author Message
 Post subject: ClassCastException after update to 3.5.
PostPosted: Tue Jun 08, 2010 10:40 am 
Regular
Regular

Joined: Thu Nov 26, 2009 8:45 am
Posts: 78
As described in some other threads, i'm currently migrating my project from Hibernate 3.2.6 to Hibernate 3.5.
I get the following exception:
Code:
java.lang.ClassCastException: cannot assign instance of org.hibernate.proxy.pojo.javassist.SerializableProxy to field org.jbpm.graph.exe.ProcessInstance.processDefinition of type org.jbpm.graph.def.ProcessDefinition in instance of org.jbpm.graph.exe.ProcessInstance


it occurs when i'm tryin to recieve some objects from the db. The ProcessInstace Class is mapped like this:

Code:
...
<set name="processInstances" table="VORGANG_PROCESS_INST" lazy="true">         
   <key column="VORGANG_ID"/>
      <many-to-many            
            class="org.jbpm.graph.exe.ProcessInstance"
            column="PROCESS_INST_ID" />
</set>   
...

edit:
--
the code, that throws the exception is this one:
Code:
                ...
      Criteria crit = dbSession.createCriteria(clazz);
      return crit.list(); <---
                ...

--
if i change the value of "lazy" to "false" here, i wont get that exception anymore.
Anybody could tell me the why this happens? ((edit: forget this!)with 3.2.6. it all works fine)


Last edited by hage on Wed Jun 09, 2010 6:57 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: ClassCastException after update to 3.5.
PostPosted: Wed Jun 09, 2010 5:23 am 
Regular
Regular

Joined: Thu Nov 26, 2009 8:45 am
Posts: 78
after try'n'error'ing a lot, i figured out that it seems that it have nothing to do with the hibernate version, after downgrading the error stays alive.


Top
 Profile  
 
 Post subject: Re: ClassCastException after update to 3.5.
PostPosted: Wed Jun 09, 2010 6:55 am 
Regular
Regular

Joined: Thu Nov 26, 2009 8:45 am
Posts: 78
i think, this is the reason for the exception. It says that the workaround is easy, but i don't understand what to do exactly. Do i have to overwrite the readResolve() of SerializableProxy?


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