1

I am currently using hadoop 2.7.2

I was wondering if there is another method from the class Job in org.apache.hadoop.mapreduce.job that can replace the method waitForCompletion(), because in my project, waitForCompletion() calls for another method called getProxy() that should be in the RPC class in the package org.apache.hadoop.ipc in hadoop-common-2.7.2, but it doesn't exist.

However there is a link that proves the existence of the getProxy() method in RPC: https://hadoop.apache.org/docs/r1.0.4/api/org/apache/hadoop/ipc/RPC.html

If you want to have a detailed description of the source problem here is the link:

hadoop mapreduce java program exception: java.lang.NoSuchMethodError

Any help will be appreciated. Thank you

Community
  • 1
  • 1

1 Answers1

0

Can you try adding the below dependency and run once.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>ncku.hpds.tzulitai</groupId>
    <artifactId>distributed-svm</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <artifactId>cascade-svm-mr</artifactId>
  <name>cascade-svm-mr</name>
  <description>The Cascade SVM approach, implemented with MapReduce</description>
  <build>
  <plugins>
    <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
            <source>1.7</source>
            <target>1.7</target>
        </configuration>
    </plugin>
   </plugins>
  </build>
  <dependencies>
    <dependency>
        <groupId>tw.edu.ntu.csie</groupId>
        <artifactId>libsvm</artifactId>
        <version>3.17</version>
    </dependency>
            <!-- BIG DATA -->
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-common</artifactId>
            <version>2.7.2</version>
        </dependency>

        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-client</artifactId>
            <version>2.7.2</version>
        </dependency>
  </dependencies>
</project>
Makubex
  • 419
  • 3
  • 19
  • Hi Makubex, i added it in the pom file, it gives the same error. Actually i just figured the cause of the problem: There is an instance of the `JobClient` classs , from the package `org.apache.hadoop.mapred`, calling for a method `createRPCProxy()`, that doesn't even exist. Maybe if you have an idea about it, it would very helpful to find an alternative to replace it. Thank you Makubex. – Walid Ksiaa May 31 '16 at 16:22
  • I've edited my answer with new dependency. Guess that should solve your issue. – Makubex Jun 01 '16 at 04:25
  • share your pom.xml – Makubex Jun 02 '16 at 04:22
  • I cannot share it on commentary because it's tool long. However here is the link where i got the project, it will be easier for you: https://github.com/tzulitai/distributed-svm In this project, i'm interested in the **cascade svm** project. I just followed the build info that is located at the bottom of the page of the link that i gave above. Thank you for your support :) – Walid Ksiaa Jun 02 '16 at 13:39
  • In the given pom.xml, i'm still seeing hadoop-mapreduce-client-core. Also it's pointing to 2.4.1. The above dependency should be working for 2.7.2. – Makubex Jun 03 '16 at 07:07
  • Also, if you have a sample data set to test your project, please share so that i can test your project with appropriate dependancy. +Also provide hadoop jar command for running your jar(incase if you have any user defined parm -D). – Makubex Jun 03 '16 at 07:09
  • Hi Makubex. Actually the dataset is from this link (The libsvm website): https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary.html#a1a the chosen dataset is "a1a" (the first link): Right click on the link and choose "Save link as...." **Now according the hadoop jar command:** Authentication to hadoop user (hduser) , then, `cd distributed-svm`-------------------------`hduser@hadoopmaster:~/distributed-svm$ 'usr/local/hadoop/bin/hadoop' jar 'location of jar file' ncku.hpds.tzulitai.mapreduce.svm.cascade.CascadeSvm /user/hduser/input/a1a /user/hduser/output` Regards – Walid Ksiaa Jun 03 '16 at 10:56
  • It's asking for args[2] value... third argument - Subset count Please let me know what it is... – Makubex Jun 03 '16 at 12:56
  • I ran with subset value as 14 and it ran without any issue. I dont see any issue with the dependancy i've used. I've updated my answer with the complete pom.xml FYI, i jus changed jre to 1.7 since i'm using that in my machine. – Makubex Jun 03 '16 at 13:18
  • 1.7 , You mean the jdk version used in the maven installation ? Because is went in the maven plugin, MANIFEST info , and i saw JDK : 1.7.0 Is that is, or is it something else ?? Regards :) – Walid Ksiaa Jun 03 '16 at 13:23
  • I have 2 questions, just to make sure because i got i little bit confused: 1/ I didn't find Maven-compiler-plugin-2.3.2.jar, and i just downloaded it, where should i put it exactly, in hadoop home directory or in maven home directory? 2/ Also i didn't find Hadood-client-2.7.2.jar and i just downloaded it, should i put in hadoop common directory, or somewhere else ? Sorry if i took too much of your time to solve the issue – Walid Ksiaa Jun 03 '16 at 14:38
  • No probs :) 1)maven compiler plugin 2.3.2 is added in the plugin tag of pom. It comes under .m2 repository 2)Jus give maven install command for cascade-svm-mr [cascade-svm-mr]$ mvn eclipse:clean eclipse:eclipse clean install – Makubex Jun 03 '16 at 18:47
  • I exported the jar as from eclipse itself. Also I'm assuming you are running the dependencides. Because if you download the hadoop-client jar directly, you wont be having the other dependancy jars required for it. – Makubex Jun 03 '16 at 18:50
  • Sorry, for not responding for a long time, but it finally worked. I just checked my hadoop installation, and i got configuration issues (too hard to explain), however, i met another exception. `java.io.FileNotFoundException: File does not exist: hdfs://hadoopmaster:9000/user/hpds/libsvm.jar`. I guess a libsvm jar is missing... – Walid Ksiaa Jun 05 '16 at 13:24
  • Cool...:) Yea i too noticeed libsvm.jar being used in the code. It's already part of the pom.xml. You can move it from your .m2 repo to hdfs. – Makubex Jun 05 '16 at 17:48
  • I did it, and it worked, however there is another exception, NoSuchElementException `java.lang.Exception: java.util.NoSuchElementException at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462) at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522) Caused by: java.util.NoSuchElementException at java.util.StringTokenizer.nextToken(StringTokenizer.java:349) at ncku.hpds.tzulitai.mapreduce.svm.cascade.CascadeSvm$SvmTrainer.formSvmProblem(CascadeSvm.java:154) .........` This never ends..... But i got an output, maybe incomplete. – Walid Ksiaa Jun 05 '16 at 19:09
  • Just one more thing, what did you get in the output file , or the result was exposed in the terminal ?? – Walid Ksiaa Jun 05 '16 at 19:49
  • I haven't gone through the code to see what's the expected output. But I noticed some logger info on the terminal, and some data stored in "_model_file.model" file under the MR output directory. – Makubex Jun 06 '16 at 03:50
  • The Output i got isn't the expected one, in the middle of the execution: `java.lang.Exception: java.lang.NoClassDefFoundError: libsvm/svm_node at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462) at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522) Caused by: java.lang.NoClassDefFoundError: libsvm/svm_node at ncku.hpds.tzulitai.mapreduce.svm.cascade.CascadeSvm$SvmTrainer.formSvmProblem(CascadeSvm.java:156) at ncku.hpds.tzulitai.mapreduce.svm.cascade.CascadeSvm$SvmTrainer.(CascadeSvm.java:143)` and im sure i put libsvm.jar on hdfs – Walid Ksiaa Jun 06 '16 at 10:52
  • Have u added the svm jar in hdfs that is provided as distributed cache in the code. DistributedCache.addFileToClassPath( new Path("/user/makubex/jar/libsvm-3.17.jar"), cascadeConfs[remainingConfs]); – Makubex Jun 06 '16 at 10:56
  • Yup, I have specified in the code : `DistributedCache.addFileToClassPath( new Path("/user/hpds/libsvm-3.17.jar"), cascadeConfs[remainingConfs])`, then, inside the user directory, i created a directory hpds in hdfs, and i put libsvm-3.17.jar, but still nothing :( – Walid Ksiaa Jun 06 '16 at 14:14
  • svm_node class is available in the libsvm-3.17.jar. Your distributed cache is not working properly. – Makubex Jun 06 '16 at 15:06
  • Finally, it worked. Actually the problem was not from the distributed cache, but from the jdk version of the libsvm.jar file that i downloaded, i was supposed to take a libsvm.jar built on 1.8 jdk, but i used 1.7 jdk, because i'm currently using 1.8. Thanks a lot makubex :) – Walid Ksiaa Jun 09 '16 at 11:20