How to fix : java.lang.NoClassDefFoundError: org/ w3c/ dom/ ElementTraversal?

java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal

In order to fix above error we need to remove the existing Apache POI dependency and add the below mentioned dependencies in  POM.xml:

     <dependency>
                <groupId>xml-apis</groupId>
                <artifactId>xml-apis</artifactId>
                <version>1.4.01</version>
            </dependency>

            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi-ooxml</artifactId>
                <version>3.9</version>
                <exclusions>
                    <exclusion>
                        <artifactId>xml-apis</artifactId>
                        <groupId>xml-apis</groupId>
                    </exclusion>       
                </exclusions>
            </dependency>
 
java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal 

Post a Comment

1 Comments