java.lang.NoClassDefFoundError: org/apache/xerces/jaxp/DocumentBuilderFactoryImpl

Any suggestions to resolve this issue, exception details as below

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xerces/jaxp/DocumentBuilderFactoryImpl
    at com.fgn.odf.model.odfParserM.loadOdfDocument(odfParserM.java:34)
    at com.fgn.odf.OdfConverterApplication.main(OdfConverterApplication.java:15)
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 2 more

This happens when it reach here (code mentioned below) – and this class is from a library added to pom.xml(maven dependencies)

OdfPackage pkg = OdfPackage.loadPackage(documentPath);

Anybody please suggests me what could be wrong ??

Answer

add maven dependency for org.apache.xerces.jaxp

<dependency>
 <groupId>xerces</groupId> 
 <artifactId>xerces</artifactId>
 <version>2.4.0</version> 
</dependency>