线程“main”java.lang中出现异常verifyerror:操作数堆栈上的类型错误

ct3nt3jp  于 2021-06-03  发布在  Hadoop
关注(0)|答案(2)|浏览(277)

在给定的input.txt文件中查找最高温度的map reduce程序中发生了此错误。我写了两个专栏,分别是年份和温度。

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                 

    at org.apache.hadoop.mapred.LocalJobRunner.<init>(LocalJobRunner.java:422)
    at org.apache.hadoop.mapred.JobClient.init(JobClient.java:488)
    at org.apache.hadoop.mapred.JobClient.<init>(JobClient.java:473)
    at org.apache.hadoop.mapreduce.Job$1.run(Job.java:513)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1614)
    at org.apache.hadoop.mapreduce.Job.connect(Job.java:511)
    at org.apache.hadoop.mapreduce.Job.submit(Job.java:499)
    at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:530)
    at com.letsdobigdata.MaxTemperatureDriver.run(MaxTemperatureDriver.java:35)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
    at com.letsdobigdata.MaxTemperatureDriver.main(MaxTemperatureDriver.java:41)
lmyy7pcs

lmyy7pcs1#

这基本上是jvm执行堆栈上的类型不匹配。
肯定是hadoop中的一个bug。

ws51t4hk

ws51t4hk2#

请尝试将jdk版本降低到7.0,并从oracle网站下载jdk。
我可以用jdk7解决这个问题。

相关问题