Results 1 to 3 of 3

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

  1. #1
    Join Date
    Oct 2012
    Posts
    7

    Default 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. #2
    Join Date
    Oct 2012
    Posts
    7

    Default

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

    Is it intended and legal?

  3. #3
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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?
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •