java.lang.ClassCastException: org.dom4j.tree.DefaultElement

Hibernate JIRA | Winston Huang | 1 decade ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    when importing from xml format and trying to save the instance using dom4jsession, i got the following exception. it would succeed if i don't use an optimistic locking object (with versioning). see the attached test case for details. i have a many-to-many set relationship from user to role. the xml data files are in User.xml and Role.xml. loading Role.xml is fine. but loading User.xml failed. log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please initialize the log4j system properly. Exception in thread "main" java.lang.ClassCastException: org.dom4j.tree.DefaultElement at org.hibernate.event.def.DirtyCollectionSearchVisitor.processCollection(DirtyCollectionSearchVisitor.java:50) at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:104) at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:64) at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:58) at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:301) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:111) 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.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:329) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86) at TestDom4jVersionedObject.main(TestDom4jVersionedObject.java:26)

    Hibernate JIRA | 1 decade ago | Winston Huang
    java.lang.ClassCastException: org.dom4j.tree.DefaultElement
  2. 0

    when importing from xml format and trying to save the instance using dom4jsession, i got the following exception. it would succeed if i don't use an optimistic locking object (with versioning). see the attached test case for details. i have a many-to-many set relationship from user to role. the xml data files are in User.xml and Role.xml. loading Role.xml is fine. but loading User.xml failed. log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please initialize the log4j system properly. Exception in thread "main" java.lang.ClassCastException: org.dom4j.tree.DefaultElement at org.hibernate.event.def.DirtyCollectionSearchVisitor.processCollection(DirtyCollectionSearchVisitor.java:50) at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:104) at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:64) at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:58) at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:301) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:111) 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.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:329) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86) at TestDom4jVersionedObject.main(TestDom4jVersionedObject.java:26)

    Hibernate JIRA | 1 decade ago | Winston Huang
    java.lang.ClassCastException: org.dom4j.tree.DefaultElement
  3. 0

    jroller.com | 9 months ago
    java.lang.ClassCastException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.dom4j.tree.DefaultElement

      at org.hibernate.event.def.DirtyCollectionSearchVisitor.processCollection()
    2. Hibernate
      SessionImpl.managedFlush
      1. org.hibernate.event.def.DirtyCollectionSearchVisitor.processCollection(DirtyCollectionSearchVisitor.java:50)
      2. org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:104)
      3. org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:64)
      4. org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:58)
      5. org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:301)
      6. org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:111)
      7. org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:190)
      8. org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:70)
      9. org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
      10. org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
      11. org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:329)
      11 frames
    3. Hibernate
      JDBCTransaction.commit
      1. org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
      1 frame
    4. Unknown
      TestDom4jVersionedObject.main
      1. TestDom4jVersionedObject.main(TestDom4jVersionedObject.java:26)
      1 frame