hadoop This parser does not support specification "null" version "null"

在eclipse中连接hadoop调试的时候出现下面的Exception:

 

[main] ERROR Configuration : Failed to set setXIncludeAware(true) for parser org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@143ed74: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(Unknown Source) at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1275) at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1251) at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:1192) at org.apache.hadoop.conf.Configuration.get(Configuration.java:415) at org.apache.hadoop.hbase.HBaseConfiguration.checkDefaultsVersion(HBaseConfiguration.java:63) at org.apache.hadoop.hbase.HBaseConfiguration.addHbaseResources(HBaseConfiguration.java:76) at org.apache.hadoop.hbase.HBaseConfiguration.create(HBaseConfiguration.java:86)

 

 

解决方法:在JVM启劝参数中增加:

-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.documentbuilderfactoryimpl

再设置两个属性(javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.SAXParserFactory)值如下:

        System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
            "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
        System.setProperty("javax.xml.parsers.SAXParserFactory",
            "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl");

 

你可能感兴趣的:(hdoop)