如何解决“[致命错误] hive-default.xml:1:1:prolog中不允许内容”HIVE中的错误

时间:2014-09-26 20:05:31

标签: hadoop hive

我在启动Hive时遇到错误

root@ubuntu:~# hive
[Fatal Error] hive-default.xml:1:1: Content is not allowed in prolog.
Exception in thread "main" java.lang.RuntimeException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1401)
    at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1269)
    at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:1200)
    at org.apache.hadoop.conf.Configuration.get(Configuration.java:415)
    at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:663)
    at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:595)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:434)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:197)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180)
    at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1300)
    ... 11 more
root@ubuntu:~# 

有人请帮我解决这个问题。 提前谢谢。

1 个答案:

答案 0 :(得分:0)

如您所见,错误来自hive-default.xml

请查看此文件。在xml文件的起始处可能有一个空格或任何其他文本导致错误 您可以在stackoverflow org.xml.sax.SAXParseException: Content is not allowed in prolog上引用此问题,该问题与您获得的错误相同,只是针对不同的文件

hive-default.xml.template位于安装根目录的conf目录中。

您可能希望创建hive-site.xml以覆盖默认值