?Hey there,
I am using the Cobertura-maven plugin to test some code which uses Hadoop and I
get the following error message from inside the Hadoop code when certain tests
run:
ERROR org.apache.hadoop.conf.Configuration - Failed to set
setXIncludeAware(true) for parser
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@3f13af36:java.lang.UnsupportedOperationException:
setXIncludeAware is not supported on this JAXP implementation or earlier:
class org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
java.lang.UnsupportedOperationException: setXIncludeAware is not supported on
this JAXP implementation or earlier: class
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
at
javax.xml.parsers.DocumentBuilderFactory.setXIncludeAware(DocumentBuilderFactory.java:614)
at
org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2216)
I have traced this down to a version incompatibility between the version of
Xerces that Hadoop uses and the one the plugin uses (2.6.2). Our code doesn't
directly use Xerces so we currently don't have a Maven dependency on it, this
means it fetches it transitively and unfortunately the version from the plugin
is the one which is used which causes the above error. I can fix this by adding
the following to my pom:
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
<scope>test</scope>
</dependency>
However, I would prefer not to have to do this in all our POMs and was
wondering if there are any plans to release a new version of the plugin which
uses a newer version of Xerces? I tried following the dependency chain to find
exactly where it's coming from but didn't succeed. I'm happy to help with
contributing a patch if someone can point me in the right direction. If raising
a Jira is the preferred way to proceed I can do that too.
Thanks,
Adrian