Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory

Tags:

wildfly-10

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>
like image 876
Progs Avatar asked Dec 02 '25 10:12

Progs


1 Answers

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

like image 117
James R. Perkins Avatar answered Dec 07 '25 07:12

James R. Perkins



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!