【问题标题】:The exception java.lang.VerifyError: Bad type on operand stack happend in Heron异常 java.lang.VerifyError: Bad type on operand stack occurred in Heron
【发布时间】:2018-09-19 03:38:41
【问题描述】:

我尝试使用以下代码从 zookeeper 获取 PhysicalPlan:

String stateMgrClass = Context.stateManagerClass(this.config);
IStateManager stateManager = null;
stateManager = ReflectionUtils.newInstance(stateMgrClass);
stateManager.initialize(this.config);
SchedulerStateManagerAdaptor stateManagerAdaptor = new SchedulerStateManagerAdaptor(stateManager, 5000);
PhysicalPlans.PhysicalPlan physicalPlan = stateManagerAdaptor.getPhysicalPlan(this.topologyName);

然后异常:java.lang.VerifyError: Bad type on operand stack 发生:

Exception in thread "Thread-4" java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    com/twitter/heron/proto/system/PhysicalPlans$PhysicalPlan$Builder.mergeTopology(Lcom/twitter/heron/api/generated/TopologyAPI$Topology;)Lcom/twitter/heron/proto/system/PhysicalPlans$PhysicalPlan$Builder; @72: invokevirtual
  Reason:
    Type 'com/twitter/heron/api/generated/TopologyAPI$Topology' (current frame, stack[1]) is not assignable to 'com/google/protobuf/AbstractMessage'
  Current Frame:
    bci: @72
    flags: { }
    locals: { 'com/twitter/heron/proto/system/PhysicalPlans$PhysicalPlan$Builder', 'com/twitter/heron/api/generated/TopologyAPI$Topology' }
    stack: { 'com/google/protobuf/SingleFieldBuilderV3', 'com/twitter/heron/api/generated/TopologyAPI$Topology' }
  Bytecode:
    0x0000000: 2ab4 0014 c700 3f2a b400 1604 7e04 a000
    0x0000010: 292a b400 09c6 0022 2ab4 0009 b800 4fa5
    0x0000020: 0018 2a2a b400 09b8 0055 2bb6 0056 b600
    0x0000030: 57b5 0009 a700 082a 2bb5 0009 2ab6 0037
    0x0000040: a700 0c2a b400 142b b600 5857 2a59 b400
    0x0000050: 1604 80b5 0016 2ab0                    
  Stackmap Table:
    same_frame(@55)
    same_frame(@60)
    same_frame(@67)
    same_frame(@76)

    at com.twitter.heron.proto.system.PhysicalPlans$PhysicalPlan.toBuilder(PhysicalPlans.java:4211)
    at com.twitter.heron.proto.system.PhysicalPlans$PhysicalPlan.newBuilder(PhysicalPlans.java:4204)
    at com.twitter.heron.statemgr.FileSystemStateManager.getPhysicalPlan(FileSystemStateManager.java:165)
    at com.twitter.heron.spi.statemgr.SchedulerStateManagerAdaptor.getPhysicalPlan(SchedulerStateManagerAdaptor.java:289)
    at zyt.custom.my.scheduler.aurora.AuroraSchedulerController.basedWeightSchedule(AuroraSchedulerController.java:782)
    at zyt.custom.my.scheduler.aurora.AuroraSchedulerThread.run(AuroraSchedulerThread.java:54)

我不知道是什么导致了这个异常。感谢您的帮助。

【问题讨论】:

    标签: java heron


    【解决方案1】:

    当类的版本在编译时和运行时不同时会引发异常。

    最近,当我尝试使用旧版本的探查器时遇到了这样一个问题,并且在探查器启动时,将要调用某个操作时会抛出 verifyError。

    【讨论】:

    • 那么,关于如何解决这个问题有什么建议吗?
    • 我的问题是因为我的分析器,当我更改它的版本时,所有事情都正确完成。首先,您应该检查 Heron 的版本,最后,如果有任何版本不兼容,您应该使用更新的版本。
    • 这个问题是在我将一个函数添加到一个类之后发生的。在我添加功能之前,所有事情都正确完成。但是,即使我删除了该函数并重新编译了我的项目的.jar文件,这个问题仍然存在。苍鹭版本我查过了,没有问题。
    【解决方案2】:

    这个问题已经通过从 pom.xml 文件中删除 heron-api:[heron-version].jar 解决了。
    heron-spi:[heron-version].jar 是创建 Heron 的自定义调度程序所必需的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-30
      • 2020-04-14
      • 1970-01-01
      • 2019-09-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多