Hi ya,
An error I was investigating was being thrown deep inside the Hibernate code base and I suspected it wasn't a bug with Hibernate, rather Hibernate wasn't telling me the full story.
The hard part was that Hibernate was throwing the exception at a particular point in the code that was making the actual issue very obscure.
Previous to encountering this issue I had changed an association in a mapping file from list to set, yet I changed the Java file set method signature to Collection with the underlying implementation as ArrayList. Obviously this is the reason for the error. However I had made this change a few days before and it was out of my mind. The error message does not direct me to where the actual issue is beyond telling me to search my code for ArrayList, of which I have many.
Is it possible for the Hibernate exceptions to be more descriptive and direct me to the particular association that is causing the issue?
Regards.
java.lang.ClassCastException: java.util.ArrayList
at org.hibernate.type.SetType.wrap(SetType.java:39)
at org.hibernate.event.def.WrapVisitor.processArrayOrNewCollection(WrapVisitor.java:84)
at org.hibernate.event.def.WrapVisitor.processCollection(WrapVisitor.java:51)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:101)
at org.hibernate.event.def.WrapVisitor.processValue(WrapVisitor.java:98)
at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:55)
at org.hibernate.event.def.DefaultFlushEntityEventListener.wrapCollections(DefaultFlushEntityEventListener.java:178)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:111)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:954)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1099)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:749)
|