-1

when I run schematool -dbType mysql -initSchema command in command prompt it is throwing below error -

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration at java.lang.Class.privateGetMethodRecursive(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
1

1 Answer 1

0

Check in Classpath that all the necessary JARs are included You can add the path of the Hadoop JARs using the HADOOP_CLASSPATH environment variable:

export HADOOP_CLASSPATH=/path/to/hadoop/conf:/path/to/hadoop/lib/*

Checks that Hadoop is correctly installed and configured on the system

Adds the required JARs manually to the classpath, including the JAR containing the Configuration class:

java -cp /path/to/hadoop/conf:/path/to/hadoop/lib/hadoop-common-*.jar:/path/to/hadoop/lib/hadoop-hdfs-*. jar:/path/to/hadoop/lib/hadoop-mapreduce-*.jar:/path/to/hadoop/lib/hadoop-yarn-*.jar org.apache.hadoop.hive.ql.tools.HiveSchemaTool -dbType mysql -initSchema

Check all dependencies are present and there are no version conflicts

If the problem persists, reinstall Hadoop to ensure that all the necessary files are present and configured correctly.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.