Dear all,
I am trying to connect Hive through my application but i am getting the
following error :
12:03:10 ERROR conf.Configuration: Failed to set setXIncludeAware(true)
for parser
org.apache.xerces.jaxp.documentbuilderfactoryi...@8888e6c: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 org.apache.hadoop.conf.Configuration.getProps(Configuration.java:980)
at
org.apache.hadoop.conf.Configuration.iterator(Configuration.java:1016)
at
org.apache.hadoop.hive.conf.HiveConf.getUnderlyingProps(HiveConf.java:294)
at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:308)
at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:285)
at
org.apache.hadoop.hive.jdbc.HiveConnection.<init>(HiveConnection.java:45)
at org.apache.hadoop.hive.jdbc.HiveDriver.connect(HiveDriver.java:69)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at
org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at
org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1823)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1143)
at SelectClauseExample.main(SelectClauseExample.java:19)
10/09/17
I googled a lot and find the root cause that my xerces-j2-2.7.1.jar is
not supporting this advanced document parsing. But I'm not able to k now
that how can I change the value of
org.apache.xerces.jaxp.SAXParserImpl and which advanced jar file I
needed to run this.
I find a solution but don't know how to set this parameter in Java in
Eclipse or through command line.
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"
Following command shows that xerce.jar is in use.
$ ant -diagnostics
XML Parser information
-------------------------------------------
XML Parser : org.apache.xerces.jaxp.SAXParserImpl
XML Parser Location: /usr/share/java/xerces-j2-2.7.1.jar
Thanks for any help.