FAQ
Hello,

I am trying to get Lars George MapReduce example working against CDH4.1.

$ git clone git://github.com/larsgeorge/hbase-book.git
$ cd hbase-book/ch07

just changing pmo.xml with
diff --git a/ch07/pom.xml b/ch07/pom.xml
index e0c12d1..fbd47bc 100644
--- a/ch07/pom.xml
+++ b/ch07/pom.xml
@@ -50,9 +50,8 @@
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-core</artifactId>
- <version>0.20-append-r1057313</version>
- <scope>provided</scope>
+ <artifactId>hadoop-mapreduce-client-jobclient</artifactId>
+ <version>2.0.0-cdh4.1.1</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
@@ -123,4 +122,16 @@
</build>
</profile>
</profiles>
+ <repositories>
+ <repository>
+ <id>cloudera-releases</id>
+ <url>https://repository.cloudera.com/artifactory/cloudera-repos</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
</project>

# removing WARNING on deprecated API ("new Job" becomes "Job.getInstance" )
sed -i 's/new Job/Job.getInstance/' src/main/java/mapreduce/*.java

[...]
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] [jar:jar {execution: default-jar}]
[INFO] Building jar:
/home/viaduc436/SOURCE/GIT/hbase-book2/ch07/target/hbase-book-ch07-1.0.jar
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL


BUT !!

When I try to run it I get an error :
$ hadoop jar target/hbase-book-ch07-1.0.jar
Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.hadoop.util.ProgramDriver.driver([Ljava/lang/String;)V
at mapreduce.Driver.main(Driver.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:208)


Where am I doing it wrong ?

Chhers,

--
Damien

--

Search Discussions

  • Damien Hardy at Nov 6, 2012 at 12:13 pm
    I am able to run a Job of the package with :
    export
    HADOOP_CLASSPATH=/usr/lib/hbase/hbase.jar:target/hbase-book-ch07-1.0.jar
    hadoop mapreduce.ImportFromFile -libjars /usr/lib/hbase/hbase.jar -c
    toto:test -i employees -t toto

    ProgramDriver class is not used so and skipped. But does not explain my
    problem.

    Cheers,
    --
    Damien

    Le lundi 5 novembre 2012 17:32:28 UTC+1, Damien Hardy a écrit :
    Hello,

    I am trying to get Lars George MapReduce example working against CDH4.1.

    $ git clone git://github.com/larsgeorge/hbase-book.git
    $ cd hbase-book/ch07

    just changing pmo.xml with
    diff --git a/ch07/pom.xml b/ch07/pom.xml
    index e0c12d1..fbd47bc 100644
    --- a/ch07/pom.xml
    +++ b/ch07/pom.xml
    @@ -50,9 +50,8 @@
    </dependency>
    <dependency>
    <groupId>org.apache.hadoop</groupId>
    - <artifactId>hadoop-core</artifactId>
    - <version>0.20-append-r1057313</version>
    - <scope>provided</scope>
    + <artifactId>hadoop-mapreduce-client-jobclient</artifactId>
    + <version>2.0.0-cdh4.1.1</version>
    </dependency>
    <dependency>
    <groupId>commons-cli</groupId>
    @@ -123,4 +122,16 @@
    </build>
    </profile>
    </profiles>
    + <repositories>
    + <repository>
    + <id>cloudera-releases</id>
    + <url>https://repository.cloudera.com/artifactory/cloudera-repos
    </url>
    + <releases>
    + <enabled>true</enabled>
    + </releases>
    + <snapshots>
    + <enabled>false</enabled>
    + </snapshots>
    + </repository>
    + </repositories>
    </project>

    # removing WARNING on deprecated API ("new Job" becomes "Job.getInstance" )
    sed -i 's/new Job/Job.getInstance/' src/main/java/mapreduce/*.java

    [...]
    Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

    [INFO] [jar:jar {execution: default-jar}]
    [INFO] Building jar:
    /home/viaduc436/SOURCE/GIT/hbase-book2/ch07/target/hbase-book-ch07-1.0.jar
    [INFO]
    ------------------------------------------------------------------------
    [INFO] BUILD SUCCESSFUL


    BUT !!

    When I try to run it I get an error :
    $ hadoop jar target/hbase-book-ch07-1.0.jar
    Exception in thread "main" java.lang.NoSuchMethodError:
    org.apache.hadoop.util.ProgramDriver.driver([Ljava/lang/String;)V
    at mapreduce.Driver.main(Driver.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:208)


    Where am I doing it wrong ?

    Chhers,

    --
    Damien
    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcdh-user @
categorieshadoop
postedNov 5, '12 at 4:32p
activeNov 6, '12 at 12:13p
posts2
users1
websitecloudera.com
irc#hadoop

1 user in discussion

Damien Hardy: 2 posts

People

Translate

site design / logo © 2022 Grokbase