I'm using Maven in my project and I have a 3rd party library that uses Xerces. In my project there are some other Maven modules which has in their dependencies some others XML libraries. So my problem is, when I use this third party library in an dependent maven project it works fine. And when I use it in a maven module in my project it generate some exceptions.
org.w3c.dom.ls.LSException: unknown protocol: c
at com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl.writeToURI(DOMSerializerImpl.java:1010)
at generators.Generator.setConf(Generator.java:1567)
When I debug both projects, I remarked that in the second one it instantiate DOMSerializerImpl
class form com.sun.org.apache.xml.internal.serialize
package, and in the first one uses org.apache.xml.serialize
package. Despite the same dependencies are specified in my pom files of both projects.
The dependencies of this this party library are:
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>serializer</artifactId>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesSamples</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
Can anyone help me?