2
votes

Getting Fatal Error while running bin/hadoop namenode -format

Using Windows 7 operating system, Under C:\cygwin\usr\local\hadoop-0.20.203.0\conf edited hadoop-env.sh file,

#export JAVA_HOME=C:/Program Files/Java/jdk1.6.0_24
export JAVA_HOME=C:/jdk1.6.0_24.

I have my Java class path set to C:/jdk1.6.0_24.

Fatal Error] hdfs-site.xml:5:2: The markup in the document following the root element must be well-formed.

enter code here

$ bin/hadoop namenode -format
12/02/24 07:15:38 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = -PC/10.0.0.11
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 0.20.203.0
STARTUP_MSG:   build = http://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-203 -r 1099333; compiled by 'oom' on Wed May  4 07:57:50 PDT 2011
************************************************************/

12/02/24 07:15:38 FATAL conf.Configuration: bad conf file: top-level element not <configuration>

12/02/24 07:15:38 WARN conf.Configuration: bad conf file: element not <property>

12/02/24 07:15:38 WARN conf.Configuration: bad conf file: element not <property>

[Fatal Error] hdfs-site.xml:5:2: The markup in the document following the root element must be well-formed.

12/02/24 07:15:38 FATAL conf.Configuration: error parsing conf file: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.

12/02/24 07:15:38 ERROR namenode.NameNode: java.lang.RuntimeException: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.

        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:1124)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1141)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1162)

Caused by: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
        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:1142)
        ... 6 more

12/02/24 07:15:38 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at asoni-PC/10.0.0.11
************************************************************/
1

1 Answers

3
votes

Looks like you might have some XML formatting errors in your hdfs-site.xml. Look on line 5.