Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hadoop >> mail # user >> Hadoop cannot find my mapper class


Copy link to this message
-
Re: Hadoop cannot find my mapper class
I have solved this problem.
I used to declare the package of LangAnal.java as "org.etri.mp2893"
But when I changed it to "org.myorg", the problem was gone.
This is really baffling.
Does anybody have any idea why this happens?

2010/6/7 edward choi <[EMAIL PROTECTED]>

> Hi, I am trying to run a JNI application on Hadoop and I keep getting an
> error message that my Mapper class cannot be found.
>
> I have a dynamic library(libetri_lmi.so).
> A java file that calls the library(freeparser.java). Freeparser.java
> declares native functions.
> Another java file which is the hadoop application(LangAnal.java).
>
> LangAnal.java imports freeparser.java.
> LangAnal.java has one Mapper function and zero Reducer function.
>
> I have compiled freeparser.java and LangAnal.java.
> I got three classes (freeparser.class, LangAnal.class,
> LangAnal$LangAnalMapper.class)
> I have archived the three classes into one jar file(LangAnal.jar)
>
> Then I run
> Hadoop jar ./LangAnal.jar org.etri.mp2893.LangAnal ./input ./output
>
> Then I get the following message.
>
> I am definitely sure that my Mapper class is in the jar file.
> I did not get this message before. So I tried formating the namenode, but
> didn't work.
> What can I be doing wrong??
>
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> 10/06/07 10:31:15 WARN mapred.JobClient: Use GenericOptionsParser for
> parsing the arguments. Applications should implement Tool for the same.
> 10/06/07 10:31:15 WARN mapred.JobClient: No job jar file set.  User classes
> may not be found. See JobConf(Class) or JobConf#setJar(String).
> 10/06/07 10:31:15 INFO input.FileInputFormat: Total input paths to process
> : 1
> 10/06/07 10:31:16 INFO mapred.JobClient: Running job: job_201006071023_0003
> 10/06/07 10:31:17 INFO mapred.JobClient:  map 0% reduce 0%
> 10/06/07 10:31:27 INFO mapred.JobClient: Task Id :
> attempt_201006071023_0003_m_000000_0, Status : FAILED
> java.lang.RuntimeException: java.lang.ClassNotFoundException:
> org.etri.mp2893.LangAnal$LangAnalMapper
>  at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:809)
> at
> org.apache.hadoop.mapreduce.JobContext.getMapperClass(JobContext.java:157)
>  at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:569)
> at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
>  at org.apache.hadoop.mapred.Child.main(Child.java:170)
> Caused by: java.lang.ClassNotFoundException:
> org.etri.mp2893.LangAnal$LangAnalMapper
>  at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> at java.security.AccessController.doPrivileged(Native Method)
>  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>  at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
>  at
> org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:762)
> at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:807)
>  ... 4 more
>
> 10/06/07 10:31:33 INFO mapred.JobClient: Task Id :
> attempt_201006071023_0003_m_000000_1, Status : FAILED
> java.lang.RuntimeException: java.lang.ClassNotFoundException:
> org.etri.mp2893.LangAnal$LangAnalMapper
>  at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:809)
> at
> org.apache.hadoop.mapreduce.JobContext.getMapperClass(JobContext.java:157)
>  at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:569)
> at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
>  at org.apache.hadoop.mapred.Child.main(Child.java:170)
> Caused by: java.lang.ClassNotFoundException:
> org.etri.mp2893.LangAnal$LangAnalMapper
>  at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> at java.security.AccessController.doPrivileged(Native Method)
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB