Apache Hadoop setXIncludeAware UnsupportedOperationException [英] Apache Hadoop setXIncludeAware UnsupportedOperationException
问题描述
无法设置setXIncludeAware (true)解析器org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@2662e5cf:java.lang.UnsupportedOperationException
完整堆栈跟踪:
13/10/17 17:22 :52错误conf.Configuration:无法为解析器设置setXIncludeAware(true)org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@2662e5cf:java.lang.UnsupportedOperationException:此JAXP实现或更早版本不支持setXIncludeAware:class org.apache。 xerces.jaxp.DocumentBuilderFactoryImpl
java.lang.UnsupportedOperationException:此JAXP实现或更早版本不支持setXIncludeAware:class javax.xml.parsers.DocumentBuilderFactory.setXIncludeAware上的org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
(DocumentBuilderFactory.java:589)
在org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1131)
在org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1107)
在org.apache .hadoop.conf.Configuration.getProps(Configuration.java:1053)
位于org.apache.hadoop.conf.Configuration.get(Configuration.java:460)
位于org.apache.hadoop.fs .FileSystem.getDefaultUri(FileSystem.java:132)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:124)
在main.JobExecutor.executeModelCreation(JobExecutor.java:223 )
在main.JobExecutor.main(JobExecutor.java:256)
在sun.reflect.NativeMethodAccessorImpl.invoke0(本地方法)
在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java :57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org。 apache.hadoop.util.RunJar.main(RunJar.java:160)
我一直在寻找近3天的解决方案,我发现了几个网站(比如这个: Hadoop无法为解析器设置setXIncludeAware(true)错误以及如何解决它),它建议将xerces和xalan添加到maven依赖项中。还有其他网站,这些网站建议非常相反 - 从classpath中删除所有xerces引用。但是建议的解决方案还没有正常运行:(
我也试过了:
System.setProperty(javax.xml.parsers.DocumentBuilderFactory,com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl);
到我的代码中,但它并没有帮助:
我是使用Apache Hadoop 1.21,正如我所说的,JDK 1.7.0-17。
在我的情况下,它过时了Maven组件依赖关系 xerces-impl 2.4.0
(由于在测试阶段使用了 mockrunner 1.0.3
)。 < dependencyManagemen>
部分有帮助。
< dependencyManagement>
<依赖性>
<依赖性>
< groupId> xerces< / groupId>
< artifactId> xercesImpl< / artifactId>
< version> 2.11。 0℃; /版本>
< /依赖关系>
< /依赖关系>
< / dependencyManagement>
Hadoop版本为 2.3.0
。 此处是另一篇文章,它描述了类似的情况。
I'm trying to get Apache Hadoop 1.21 running, but I'm getting this exception:
Failed to set setXIncludeAware(true) for parser org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@2662e5cf:java.lang.UnsupportedOperationException
full stack trace:
13/10/17 17:22:52 ERROR conf.Configuration: Failed to set setXIncludeAware(true) for parser org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@2662e5cf: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:589)
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1131)
at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1107)
at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:1053)
at org.apache.hadoop.conf.Configuration.get(Configuration.java:460)
at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:132)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:124)
at main.JobExecutor.executeModelCreation(JobExecutor.java:223)
at main.JobExecutor.main(JobExecutor.java:256)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.hadoop.util.RunJar.main(RunJar.java:160)
I have been looking for the solution for almost 3 days, I have found several websites (like this one: Hadoop "Failed to set setXIncludeAware(true) for parser" error and how to resolve it), which suggested add xerces and xalan to maven dependencies. There were also other websites, which suggested pretty much opposite - remove all xerces references from classpath. But non of the suggested solutions is working :(
I've also tried to put:
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
to my code. But it didn't help either :(
I'm using Apache Hadoop 1.21 as I said and JDK 1.7.0-17.
In my case it was outdated Maven component dependency on xerces-impl 2.4.0
(due to mockrunner 1.0.3
used on test phase). Following managed dependency added to <dependencyManagemen>
section helped.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>
</dependencies>
</dependencyManagement>
Hadoop version was 2.3.0
. Here is another article which describes similar situation.
这篇关于Apache Hadoop setXIncludeAware UnsupportedOperationException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!