问题
I have a jar in which one MapReduce class works fine while the other class with same structure - proper use of Tool, use of getConf(), etc. - fails with error 'Found interface org.apache.hadoop.mapreduce.jobcontext but class expected'. Any specific places that I should look for to fix this? Just about any help/clue would be great!
Edit: Other people with the same issue (no answer as yet on that thread either): https://groups.google.com/forum/#!msg/hipi-users/LSvktkk1YdI/yssjjc7cjeIJ
回答1:
you might have conflicting versions of a required jar files. Resolve the conflict and check.
You can also try updating the required jar file with newer version.
by resolve I mean keep only one of them
回答2:
I had to fork the repo, make a few changes (ported the project to maven to make dependency management better and changed a few classes in accordance with the external jar versions that HIPI was using) and recompile it with Hadoop-2 jars.
The 'Found interface ... class expected
' error is typical of using some jars that are compiled on Hadoop-1 and are being used with Hadoop-2.
Hope this helps someone.
来源:https://stackoverflow.com/questions/25594447/found-interface-org-apache-hadoop-mapreduce-jobcontext-but-class-expected-error