xml - 如何在 ubuntu 14.04 中使用 Apache spark 解决以下 fatal error ?

标签 xml hadoop xslt

我在运行 hadoop namenode -format 时得到的错误消息:

[Fatal Error] core-site.xml:8:5: The element type "property" must be terminated by the matching end-tag "</property>".
15/11/12 14:53:07 FATAL conf.Configuration: error parsing conf file: org.xml.sax.SAXParseException; systemId: file:/home/administrator/Downloads/FlareGet/Compressed/hadoop/conf/core-site.xml; lineNumber: 8; columnNumber: 5; The element type "property" must be terminated by the matching end-tag "</property>".
15/11/12 14:53:07 ERROR namenode.NameNode: java.lang.RuntimeException: org.xml.sax.SAXParseException; systemId: file:/home/administrator/Downloads/FlareGet/Compressed/hadoop/conf/core-site.xml; lineNumber: 8; columnNumber: 5; The element type "property" must be terminated by the matching end-tag "</property>".
    at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1237)
    at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1093)
    at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:1037)
    at org.apache.hadoop.conf.Configuration.set(Configuration.java:438)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.setStartupOption(NameNode.java:1250)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1267)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1288)
Caused by: org.xml.sax.SAXParseException; systemId: file:/home/administrator/Downloads/FlareGet/Compressed/hadoop/conf/core-site.xml; lineNumber: 8; columnNumber: 5; The element type "property" must be terminated by the matching end-tag "</property>".
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:338)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:177)
    at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1142)
    ... 6 more

15/11/12 14:53:07 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at Lenovo-G580/127.0.1.1
************************************************************/

我在 core-site.xml 中的代码:

<?xml version="1.0"?>
<configuration>
        <property>
                </name>hadoop.tmp.dir</name>
                <value>/app/hadoop/tmp</value>
                <description>A base for other temporary directories.</description>
        </property>
        <property>
                <name>fs.default.name</name>
                <value>hdfs://localhost:54310</value>
                <description>The name of the default file system. A URI whose scheme and authority determine the FileSystem implementation. The uri's scheme determines the config property (fs.SCHEME.impl) naming the FileSystem implementation class. The uri's authority is used to determine the host, port, etc. for a filesystem.</description>
        </property>
</configuration>

所有标签都已正确结束。但是错误仍然显示,我无法弄清楚。请帮助。

最佳答案

您的 XML 在第一个属性处有问题:标记名称关闭了两次,但从未打开过。应该是:

    <property>
            <name>hadoop.tmp.dir</name>
            <value>/app/hadoop/tmp</value>
            <description>A base for other temporary directories.</description>
    </property>

关于xml - 如何在 ubuntu 14.04 中使用 Apache spark 解决以下 fatal error ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33668158/

相关文章:

hadoop - hadoop环境中的copyToLocal返回什么?

spring - Spring batch和cloudera hadoop之间的版本不兼容

jquery - 如何减去xslt中的值?

php - Azure Function App - PHP 和 XML 输出

xml - AppendChild到XML的特定位置

xml - 试图将 XML 数据加载到 Hive 中......错误地解释行返回

xml - 如果所有 child 都有一个属性

android - 如何更改android中导航内容的颜色

linux - 诊断:应用程序被用户杀死

xslt - XSL 用插入符替换空格