-->
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: Hibernate 3 ClassCastException: MarkerObject
PostPosted: Tue Dec 20, 2005 4:25 pm 
Newbie

Joined: Tue Dec 20, 2005 1:32 pm
Posts: 2
I'm getting a ClassCastException when trying to retrieve an object from the database. It's being called from a unit test using the spring framework. The funny thing is, when the unit test is run by itself, the test works fine. When it's run as part of a suite of all tests in the app, it errors with the following:

java.lang.ClassCastException: org.hibernate.util.MarkerObject
at org.hibernate.engine.PersistenceContext.getCachedDatabaseSnapshot(PersistenceContext.java:310)
at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:350)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:108)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:190)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:70)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:39)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:711)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1315)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:300)
at org.springframework.orm.hibernate3.HibernateTemplate$5.doInHibernate(HibernateTemplate.java:509)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:356)
at org.springframework.orm.hibernate3.HibernateTemplate.loadAll(HibernateTemplate.java:505)
at


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 14, 2006 9:59 am 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
I'm struggling with the same exception but I'm not using springs hibernate template. does anyone have a clue what this is about?

_________________
Please don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 12:31 pm 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
I found the fix for my issue... it was a follow up error for a mapping bug of mine. Did you get any further exceptions in your log?

_________________
Please don't forget to rate


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.