Announcement Announcement Module
Collapse
No announcement yet.
error : myTool class is not assignable to interface org.apache.hadoop.util.Tool Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • error : myTool class is not assignable to interface org.apache.hadoop.util.Tool

    Hi. (I'm sorry for my english. i'm not familiar with english.)

    I wrote separate modules, 'A' (spring-hadoop/batch project) and 'B' (Hadoop MR Jar. all dependencies contained).
    'A' and 'B', both set same hadoop version(1.0.3)
    And configure in 'A'
    <hdp:tool-runner id="b-jar' configuration-ref="hadoop-config"
    jar="file://${user.dir}/B.jar"
    run-at-startup="true">
    </hdp:tool-runner>

    'B.jar' is not in 'A' 's classpath.
    'B' has org.myTool class.
    public class myTool extends Configured implements Tool
    ...

    But Exception occurred like this.
    Class [class org.myTool] is not a Tool instance.class org.myTool is not assignable to interface org.apache.hadoop.util.Tool
    ...

    I dont' know why.
    Please help.

  • #2
    Hmmm.
    Some digging,
    I removed hadoop library in 'B' (Hadoop MR Jar) and there is no problem.

    Is it intended and legal?

    Comment


    • #3
      Yes - it's not Spring Hadoop but rather a JDK classloader problem. If you ship your own Hadoop classes with your jars, these are loaded first instead of the Hadoop classes available to your app. And even though they are the same, since they are loaded by different CL, they are different entities.
      Which causes the problem aforementioned above.

      Did you use to have Hadoop jars along-side your jars when using vanilla Hadoop?

      Comment

      Working...
      X