sahar shokouhi
sahar shokouhi

Reputation: 701

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 

Upvotes: 9

Views: 2368

Answers (3)

dileepVikram
dileepVikram

Reputation: 932

The below dependencies worked for me

<dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-core</artifactId>
            <version>1.2.1</version>
        </dependency>       

        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-common</artifactId>
            <version>2.6.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-client</artifactId>
            <version>2.6.0</version>
        </dependency>     

    </dependencies>

Upvotes: 1

Bhushan Pargaonkar
Bhushan Pargaonkar

Reputation: 21

the below order for dependencies solved the problem for me.

hadoop-core 1.2.1
hadoop-common 2.6.0

Upvotes: 2

Lauri Peltonen
Lauri Peltonen

Reputation: 1542

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.

Upvotes: 9

Related Questions