[
https://issues.jboss.org/browse/WFLY-6137?page=com.atlassian.jira.plugin....
]
Karl Nicholas commented on WFLY-6137:
-------------------------------------
The reason that dom4j.jar ended up in my .war file is that I included
hibernate-entitymanager, version 5.0.7.Final in my pom.xml. I didn't even need it
because I took the class that was using it out of the application and rebuilt everything.
Background, I started with a new Java EE Web project, from Jboss developer tools
(9.1.0.Beta2). I was created a class in my project to generate the database schema, which
it seems reasonable to do. So, for that needed hibernate-entitymanger.jar, and that pulls
in the dom4j-1.6.1.jar.
Total jar file list when including, and only including without needing,
hibernate-entitymanager.jar in my project pom.xml is as follows. Without including it I
can build an application without any in the WEB-INF/lib directory.
antlr-2.7.7.jar
dom4j-1.6.1.jar
geronimo-jta_1.1_spec-1.1.1.jar
hibernate-commons-annotations-5.0.1.Final.jar
hibernate-core-5.0.7.Final.jar
hibernate-entitymanager-5.0.7.Final.jar
hibernate-jpa-2.1-api-1.0.0.Final.jar
jandex-2.0.0.Final.jar
javaassist-3.18.1-GA.jar
jboss-logging-3.3.0.Final.jar
xml-apis-1.0.b2.jar
Stack trace:
Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to
org.dom4j.DocumentFactory
at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97)
at org.hibernate.internal.util.xml.XMLHelper$1.doWork(XMLHelper.java:33)
at org.hibernate.internal.util.xml.XMLHelper$1.doWork(XMLHelper.java:27)
at
org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.workWithClassLoader(ClassLoaderServiceImpl.java:342)
at org.hibernate.internal.util.xml.XMLHelper.<init>(XMLHelper.java:26)
at
org.hibernate.envers.boot.internal.EnversServiceImpl.initialize(EnversServiceImpl.java:115)
at
org.hibernate.envers.boot.internal.AdditionalJaxbMappingProducerImpl.produceAdditionalMappings(AdditionalJaxbMappingProducerImpl.java:99)
at
org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:288)
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:847)
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:874)
at
org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
at
org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154)
... 7 more
Hope this helps.
org.dom4j.DocumentFactory cannot be cast to
org.dom4j.DocumentFactory
---------------------------------------------------------------------
Key: WFLY-6137
URL:
https://issues.jboss.org/browse/WFLY-6137
Project: WildFly
Issue Type: Feature Request
Components: Application Client, EE, JPA / Hibernate, Server
Affects Versions: 10.0.0.Final
Reporter: Karl Nicholas
Assignee: Stuart Douglas
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)