-->
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.  [ 2 posts ] 
Author Message
 Post subject: ClassCastException thrown by EntityType
PostPosted: Tue Nov 20, 2007 9:47 am 
Beginner
Beginner

Joined: Thu Nov 02, 2006 9:38 am
Posts: 32
Location: Belgium
Hibernate version:
3.2.5

Mapping documents:
Too many to list, and probably irrelevant.

Code between sessionFactory.openSession() and session.close():
Haven't been able to make a minimal test case.

Full stack trace of any exception that occurs:
java.lang.ClassCastException: paragon.model.politics.Party$$EnhancerByCGLIB$$e81dc69a
at org.hibernate.type.EntityType.toLoggableString(EntityType.java:463)
at org.hibernate.type.ComponentType.toLoggableString(ComponentType.java:381)
at org.hibernate.type.CollectionType.renderLoggableString(CollectionType.java:163)
at org.hibernate.type.CollectionType.toLoggableString(CollectionType.java:148)
at org.hibernate.pretty.Printer.toString(Printer.java:53)
at org.hibernate.pretty.Printer.toString(Printer.java:90)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:97)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811)


Name and version of the database you are using:
MySQL

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:
14:20:00,403 DEBUG AbstractFlushingEventListener:85 - Flushed: 3 insertions, 1 updates, 0 deletions to 17 objects
14:20:00,403 DEBUG AbstractFlushingEventListener:91 - Flushed: 2 (re)creations, 0 updates, 0 removals to 13 collections
14:20:00,404 DEBUG Printer:83 - listing entities:
<--------- here the exception gets thrown, and my application decides to rollback
14:20:00,418 DEBUG JDBCTransaction:152 - rollback
14:20:00,439 DEBUG JDBCTransaction:163 - rolled back JDBC Connection
1


So, I get the ClassCastException explicitly thrown by hibernate in the file (3.2.5 svn tag):

http://anonsvn.jboss.org/repos/hibernat ... yType.java

My problem is that I don't know what the class cast means at this point. It probably has something to do with the use of hibernate's proxies, since that's the type named in the exception, but I don't know what causes this problem and I sure don't know how to fix it either. I don't feel confident by just disabling all kinds of logging because it may be hiding a deeper issue.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 23, 2007 7:17 am 
Beginner
Beginner

Joined: Thu Nov 02, 2006 9:38 am
Posts: 32
Location: Belgium
Bump - I'd really like a solution... anyone any ideas?


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