xml—如何在ubuntu 14.04中解决以下apache spark的致命错误?

kd3sttzy  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(395)

运行hadoop namenode时收到的错误消息-格式:

[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>

所有标签都已正确结束。但是错误仍在显示,我无法找出它。请帮助。

ax6ht2ek

ax6ht2ek1#

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

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

相关问题