3

When i try to upload a deployment to wildlfy 10 i get this error message:

java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory 

I have tried many suggested solutions but none of them had worked for me. tried modifying the Manifest file, this question solutions, but still with the same problem, i hope someone helps me to figure out what's wrong with this issue.

This is what i had originally in all my files

jboss-deployment-structure-xml:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
    <deployment>
        <exclude-subsystems>
            <subsystem name="jpa" />
        </exclude-subsystems> 
        <exclusions>
            <module name="javaee.api" />
        </exclusions>
    </deployment>
</jboss-deployment-structure>

in the pom.xml:

       <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>${hibernate.version}</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>${hibernate.version}</version>
        </dependency>
Community
  • 1
  • 1
Progs
  • 1,059
  • 7
  • 27
  • 63

2 Answers2

1

You're including a dom4j library in your deployment. You need to determine where that is coming from and ensure it's excluded.

James R. Perkins
  • 16,800
  • 44
  • 60
0

Just to contribute with another solution, because I also got that exception. I used wildfly(10.1.0), hibernate(4.0.1.Final) and poi(3.10-FINAL). To work fine, i just upgrade poi version to 3.16.