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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via Hibernate JIRA by Martin Caslavsky, 1 year ago
org.dom4j.tree.DefaultElement
via Hibernate JIRA by Martin Caslavsky, 1 year ago
org.dom4j.tree.DefaultElement
java.lang.ClassCastException: org.dom4j.tree.DefaultElement
at org.hibernate.type.ComponentType.toLoggableString(ComponentType.java:279)
at org.hibernate.pretty.MessageHelper.infoString(MessageHelper.java:68)
at java.lang.String.valueOf(String.java:2577)
at java.lang.StringBuffer.append(StringBuffer.java:220)
at org.hibernate.util.StringHelper.toString(StringHelper.java:168)
at org.hibernate.loader.Loader.getRow(Loader.java:762)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:295)
at org.hibernate.loader.Loader.doQuery(Loader.java:389)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:208)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1367)
at org.hibernate.loader.collection.OneToManyLoader.initialize(OneToManyLoader.java:107)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.type.CollectionType.getCollection(CollectionType.java:470)
at org.hibernate.type.CollectionType.resolveKey(CollectionType.java:328)
at org.hibernate.type.CollectionType.resolve(CollectionType.java:322)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:105)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:494)
at org.hibernate.loader.Loader.doQuery(Loader.java:413)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:208)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1278)
at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:141)
at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:126)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:386)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:367)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:166)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:140)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:119)
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:59)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:80)
at org.hibernate.proxy.Dom4jLazyInitializer.getElement(Dom4jLazyInitializer.java:21)
at org.hibernate.proxy.Dom4jProxy.target(Dom4jProxy.java:561)
at org.dom4j.tree.AbstractElement.addNode(AbstractElement.java:2130)
at org.dom4j.tree.AbstractElement.add(AbstractElement.java:1412)
at undefined.Main.main(Main.java:27)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.