javaheron

The exception java.lang.VerifyError: Bad type on operand stack happend in Heron


I tried to get the PhysicalPlan from zookeeper using the following codes:

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);

And then the exceptiion: java.lang.VerifyError: Bad type on operand stack happened:

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)

I don't know what caused this exception. Thanks for your help.


Solution

  • This question has been solved by deleting the heron-api:[heron-version].jar from the pom.xml file.
    The heron-spi:[heron-version].jar is necessary to create a custom scheduler of Heron.