lucTiber
lucTiber

Reputation: 421

Hive exception when initializing using derby

i am trying to initialize hive following the instruction here (https://kontext.tech/column/hadoop/309/apache-hive-311-installation-on-windows-10-using-windows-subsystem-for-linux)

Every time I receive this exception. I understand there is an issue as there seems to have 2 SLF4J but so far it was just a warning now everything seems to go south ... any idea is welcome as usual

MyUser@My001-PC:~$ $HIVE_HOME/bin/schematool -dbType derby -initSchema SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/MyUser/hadoop/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/MyUser/hadoop/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] Exception in thread "main" java.lang.RuntimeException: com.ctc.wstx.exc.WstxParsingException: Illegal to have multiple roots (start tag in epilog?). at [row,col,system-id]: [28,2,"file:/home/MyUser/hadoop/hadoop-3.3.0/etc/hadoop/core-site.xml"] at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:3051) at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2995) at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2875) at org.apache.hadoop.conf.Configuration.get(Configuration.java:1223) at org.apache.hadoop.conf.Configuration.getTimeDuration(Configuration.java:1840) at org.apache.hadoop.conf.Configuration.getTimeDuration(Configuration.java:1817) at org.apache.hadoop.util.ShutdownHookManager.getShutdownTimeout(ShutdownHookManager.java:183) at org.apache.hadoop.util.ShutdownHookManager$HookEntry.(ShutdownHookManager.java:207) at org.apache.hadoop.util.ShutdownHookManager.addShutdownHook(ShutdownHookManager.java:304) at org.apache.hadoop.util.RunJar.run(RunJar.java:301) at org.apache.hadoop.util.RunJar.main(RunJar.java:236) Caused by: com.ctc.wstx.exc.WstxParsingException: Illegal to have multiple roots (start tag in epilog?). at [row,col,system-id]: [28,2,"file:/home/MyUser/hadoop/hadoop-3.3.0/etc/hadoop/core-site.xml"] at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:621) at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:491) at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:475) at com.ctc.wstx.sr.BasicStreamReader.handleExtraRoot(BasicStreamReader.java:2242) at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2156) at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1183) at org.apache.hadoop.conf.Configuration$Parser.parseNext(Configuration.java:3347) at org.apache.hadoop.conf.Configuration$Parser.parse(Configuration.java:3141) at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:3034) ... 10 more Exception in thread "Thread-1" java.lang.RuntimeException: com.ctc.wstx.exc.WstxParsingException: Illegal to have multiple roots (start tag in epilog?). at [row,col,system-id]: [28,2,"file:/home/MyUser/hadoop/hadoop-3.3.0/etc/hadoop/core-site.xml"] at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:3051) at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2995) at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2875) at org.apache.hadoop.conf.Configuration.get(Configuration.java:1223) at org.apache.hadoop.conf.Configuration.getTimeDuration(Configuration.java:1840) at org.apache.hadoop.conf.Configuration.getTimeDuration(Configuration.java:1817) at org.apache.hadoop.util.ShutdownHookManager.getShutdownTimeout(ShutdownHookManager.java:183) at org.apache.hadoop.util.ShutdownHookManager.shutdownExecutor(ShutdownHookManager.java:145) at org.apache.hadoop.util.ShutdownHookManager.access$300(ShutdownHookManager.java:65) at org.apache.hadoop.util.ShutdownHookManager$1.run(ShutdownHookManager.java:102) Caused by: com.ctc.wstx.exc.WstxParsingException: Illegal to have multiple roots (start tag in epilog?). at [row,col,system-id]: [28,2,"file:/home/MyUser/hadoop/hadoop-3.3.0/etc/hadoop/core-site.xml"] at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:621) at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:491) at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:475) at com.ctc.wstx.sr.BasicStreamReader.handleExtraRoot(BasicStreamReader.java:2242) at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2156) at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1183) at org.apache.hadoop.conf.Configuration$Parser.parseNext(Configuration.java:3347) at org.apache.hadoop.conf.Configuration$Parser.parse(Configuration.java:3141) at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:3034) ... 9 more

Upvotes: 0

Views: 847

Answers (1)

1218985
1218985

Reputation: 8012

It looks like you have defined multiple elements in your core-site.xml. Look at line number 28 of your /home/MyUser/hadoop/hadoop-3.3.0/etc/hadoop/core-site.xml. A well-formed XML document should have one and only one top-level (“root”) element. For instance, the below document is legal.

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->
<!-- Put site-specific property overrides in this file. -->
<configuration>
   <property>
      <name>hadoop.tmp.dir</name>
      <value>/usr/local/Cellar/hadoop/hdfs/tmp</value>
      <description>A base for other temporary directories</description>
   </property>
   <property>
      <name>fs.default.name</name>
      <value>hdfs://localhost:8020</value>
   </property>
</configuration>

On the other hand, the below document is illegal because the <configuration> element is defined twice:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->
<!-- Put site-specific property overrides in this file. -->
<configuration>
   <property>
      <name>hadoop.tmp.dir</name>
      <value>/usr/local/Cellar/hadoop/hdfs/tmp</value>
      <description>A base for other temporary directories</description>
   </property>
   <property>
      <name>fs.default.name</name>
      <value>hdfs://localhost:8020</value>
   </property>
</configuration>
<configuration>
</configuration>

Upvotes: 1

Related Questions