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.