Hadoop “Failed to set setXIncludeAware(true) for parser” 错误
今天使用Java连接Hbase的时候出现错误,异常如下:
ERROR conf.Configuration: Failed to set setXIncludeAware(true) for parser org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@47315d34:java.lang.UnsupportedOperationException:
This parser does not support specification "null" version "null"
java.lang.UnsupportedOperationException:
This parser does not support specification "null" version "null" at javax.xml.parsers.DocumentBuilderFactory.setXIncludeAware(DocumentBuilderFactory.java:590) at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1054) at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1030) at
Hadoop版本1.0.1 ,Hbase版本 0.92.1。 原因是JDK提供的XML解析库过时了。将xerces 以及 xercesImpl加入classpath即可。
更多Hadoop相关信息见Hadoop 专题页面 ?tid=13