Hadoop ClassNotFoundException

前端 未结 3 1211
名媛妹妹
名媛妹妹 2020-12-21 03:06

I\'m writing my 1st Hadoop application and I\'m getting an error. I don\'t quite understand what some of the detials in this stack trace mean. It\'s a ClassNotFoundExc

相关标签:
3条回答
  • 2020-12-21 03:15

    Does your main program need org.apache.commons.configuration.Configuration or should this be org.apache.hadoop.conf.Configuration?

    Looks like Eclipse has auto-imported the wrong Configuration class, which isn't on the classpath when hadoop runs on your cluster.

    Can you share your source code, in particular the com.sandbox.hadoop.Program class, main method?

    0 讨论(0)
  • 2020-12-21 03:19

    I was facing the same problem.I solved it by adding commons-configuration-x.x.jar to my build path.It is under $HADOOP_HOME/lib.

    0 讨论(0)
  • 2020-12-21 03:28

    You should add all the jars found in /usr/lib/hadoop-0.xx/lib to avoid this kind of classpath issues.

    To give you an idea, you can type hadoop classpath which will print you the class path needed to get the Hadoop jar and the required libraries.

    In your case, you're missing the hadoop-common-0.xx.jar, so you should add this to the classpath and you should be good to go.

    0 讨论(0)
提交回复
热议问题