Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

map reduce word count example

I want to run a simple example of word count with map reduce. but I have this problem and have no idea how to solve it.

Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    org/apache/hadoop/mapred/JobTrackerInstrumentation.create(Lorg/apache/hadoop/mapred/JobTracker;Lorg/apache/hadoop/mapred/JobConf;)Lorg/apache/hadoop/mapred/JobTrackerInstrumentation; @5: invokestatic
  Reason:
    Type 'org/apache/hadoop/metrics2/lib/DefaultMetricsSystem' (current frame, stack[2]) is not assignable to 'org/apache/hadoop/metrics2/MetricsSystem'
  Current Frame:
    bci: @5
    flags: { }
    locals: { 'org/apache/hadoop/mapred/JobTracker', 'org/apache/hadoop/mapred/JobConf' }
    stack: { 'org/apache/hadoop/mapred/JobTracker', 'org/apache/hadoop/mapred/JobConf', 'org/apache/hadoop/metrics2/lib/DefaultMetricsSystem' }
  Bytecode:
    0000000: 2a2b b200 03b8 0004 b0 
like image 829
sahar shokouhi Avatar asked Dec 10 '13 12:12

sahar shokouhi


2 Answers

I had the same problem and it got solved by removing some unneeded references in Maven (hadoop-common and hadoop-hdfs). I'm using hadoop 2.2.0 from Windows, connecting to Linux hadoop single-node cluster.

like image 68
Lauri Peltonen Avatar answered Oct 10 '22 10:10

Lauri Peltonen


the below order for dependencies solved the problem for me.

hadoop-core 1.2.1
hadoop-common 2.6.0
like image 28
Bhushan Pargaonkar Avatar answered Oct 10 '22 09:10

Bhushan Pargaonkar