The basic reason is that the classes are not compatible. Normally this conflict is because of the xml-apis.jar
file that is self-included with certain artifact assembly tools, such as maven or ant. If you are using maven remove the reference to xml-apis.jar
. If you do not use maven, make sure it does not appear inside your artifact (.war file) in the WEB-INF/lib/
directory.
<project>
...
<dependencies>
<dependency>
<groupId>biblioteca-que-usa-xml-apis</groupId>
<artifactId>artefacto</artifactId>
<version>1.0</version>
<scope>compile</scope>
...
<exclusions>
<exclusion> <!-- pon aquí la clase que quieres excluir -->
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</exclusion>
...
</exclusions>
</dependency>
</dependencies>
</project>