last day (15 days later) » 

7:55 AM
0
Q: Import Error for Mapper in Eclipese IDE. Mapreduce word count program

Basil PaulIam trying to import mapper class into Eclipse IDE. I have imported all the required jar files into Eclipse IDE. It is throwing the below given error. M not able to import Mapper class The class file Mapper contains a signature '(Lorg/apache/hadoop/mapreduce/Mapper.Contex‌​t;)V' ill-formed at po...

 
What hadoop dependencies have you imported ? Which version of jdk are you using ?
 
Hadoop Jars - hadoop-common-2.7.2.jar,hadoop-mapreduce-client-common-2.7.2‌​.jar,hadoopmapredu‌​ce‌​clientcore2.7.2.jar JDK version - 1.8
 
Can you share your jdk version ?
 
openjdk version "1.8.0_45-internal"
 
Try deleting the referenced library for your project and then re-include your jdk library. Hope this solves your issue.
 
7:55 AM
Tried that but didnt work
Any other alternative brother?
 
Thinking abt it .. coz it seems to be a prob of dependency only
one more thing
if u are using eclipse can you check whether you are including all the dependencies
you need to tick the boxes in the build path
 
How to check for that?
 
right click on project , then build path
in build path you can find jars and system library
 
Okay
M in that location
I have 3 jar files and system library files
Let me just elaborate my problem so that u can understand it easily
I have imported jar files into the project and then the problem came up when i tried extending my mapper class with the inbuilt Mapper class
I didnt get the arguments <Keyin Keyout>
It is just showing Mapper with no arguments and throwed an error
The class file Mapper contains a signature '(Lorg/apache/hadoop/mapreduce/Mapper.Contex‌​t;)V' ill-formed
 
can you share the code ?
or check one more thing
 
8:05 AM
I didnt write any code. The problem came up in the Mapper class
Okay
 
in the order and export tab, just check the jre system library if not checked
you need to write code
like
public class SampleMapperClass extends Mapper<LongWritable,Text,Text,Text>
then comes
public void map(LongWritable key, Text values, Context context)
 
Sorry for interrupting
I typed public class SampleMapperClass extends Mapper
 
ok then
 
But the arguments didnt come automatically
 
no no
you need to specify the arguments
 
8:09 AM
But it should come automatically when we presscntrl+space
 
if you do cntrl+space it should come like <KEYIN, VALUEIN, KEYOUT, VALUEOUT>
 
Yeah
Thts what
It is not comming
 
now you need to specify what type
ok
 
When i gave cntrl+space it is showing empty. Arguments are not comming
 
did you check out the order and export tab
 
8:12 AM
Where is that residing?
 
build path and then configure build path
 
After that /
?
Yeah i got
Do i need to tick that?
Checkboxes are empty
 
yes bro
please tick all the check boxes
 
Okay
Still not working
 
ohh
 
8:15 AM
import org.apache.hadoop.mapreduce.Mapper;


public class Mapper extends Mapper
{

}
My source code
M not able to get arguments for Mapper
 
public class Mapper_other_name extends Mapper
{

}
Can we try one more thing
 
yeah
 
delete the project and create a new project with the new jdk
 
okay
How to configure jdk for the project
?
 
while creating a new project
you will have the option of choosing jre
then choose jdk 1.8
 
8:22 AM
Nope
Same problem
:(
 
Then we might need to think some other options
:(
 
Okay
I did a word count program long back using the same IDE. Same error came up and i resolved that problem but m not able to recollect
So i have that project in the same IDE
In that project m able to get the arguments for Mapper class while pressing cntrl+space
 
ok
can you check
 
But not able to get for the new projects
How to compare
?
 
the library you referenced
same path
 
8:30 AM
Okay
 
build path and then configure build path
 
Same libraries
So no problem with the libraries
Order and export checkboxes are not ticked
But still that is working fine
Strange
 
ohh
and one more thing from my side
 
yeah please
 
what about the order of all the jars
first shoule be maven libraries
then jdk system library
 
8:34 AM
I dont have maven libraries
I have JRE system libraries and then 3 jar files
that i had added
 
ohh i see..
looks very strange
 
Yeah. stuck with this problem since morning
 
8:53 AM
can you restart your eclipse ?
 
9:53 AM
No brother
Didnt work
 
ohh
very bad way
copy your project (working one )
paste in your repository nd change the name
 
Which repository?
 
in the eclipse i mean to say
 
Okay
No
Didnt work
 
its very strange
 
9:59 AM
Yes bro :(
Let me know if u have any alternative. M working on that problem
 
I would suggest one more change
can you upgrade from mr 1 to mr 2
 
Okay
How to do that?
 
is it your vm or cluster ?
can you upgrade ur vm or cluster ?
 
M doing in a standalone mode
No cluster
M passing the arguments directly on eclipse
 
10:35 AM
ok
its fine
you can perhaps try the vm available
it has pre-installed hadoop
spark
 
But my mapreduce code has nothing to do with hadoop right
for my situation
 
public class Mapper_other_name extends MapReduceBase implements Mapper<LongWritable, Text, Text, IntWritable>
{

}
can you try this
i forgot this
coz u r using old api
 
Tried
Same problem
The class file Mapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT> contains a signature '(Lorg/apache/hadoop/mapreduce/Mapper<TKEYIN;TVALUEIN;TKEYOUT;TVALUEOUT;>.Contex‌​t;)V' ill-formed at position 74
 

  last day (15 days later) »