3 Replies Latest reply on Jul 25, 2005 1:01 AM by kiranlal

    Problem with Verify Error Inconsistent stack height 0 != 1

    kiranlal

      Hi

      we are using java assist to create dynamic classes. We are facing a problem of verify error. If we just print the generated code and put it in a java file and compile, it works perfect. but if we use the class file which is generated by javassist directly, then this error comes. We have a method which is having around 2500 lines which is generated.. Is that the problem ?

      it may be because of the error in the code standards, but the code size is too big to debug with normal means..
      is there a way to debug this problem ?...
      pls help...

      the generated code and the class file can be provided..
      Exception in thread "main" java.lang.VerifyError: (class: com/emirates/pie/core/parser/implementation/positional/FFM5Par
      ser, method: parseText signature: ([C)Lcom/emirates/pie/transferobjects/MessageDTO;) Inconsistent stack height 0 != 1
      at com.emirates.pie.test.ParseMsg.main(ParseMsg.java:28)

        • 1. Re: Problem with Verify Error Inconsistent stack height 0 !=
          chiba

          Can you tell us about the method parseText()?
          What kind of code did you generate?

          (please don't post 2500 lines of code...
          only overview is fine.)

          • 2. Re: Problem with Verify Error Inconsistent stack height 0 !=
            kiranlal

            Sorry for being late, I was on vacation for some time ...


            We are using it to generate a Parser which parses standard string messages. the rules are defined in the database, and using the rules, and the logic, a static method to parse the string is generated. Earlier we had lot of try catch blocks so that the stack was not building up so high. But we did some change in logic, so that the number of try catch blocks reduced.

            There are expression classe slike Loop,Statement, Condition,Block etc which is used to generate the method body string.

            but now when we use the generated class with Sun jvm we get this error. if we copy the generated code (which is passed to the Javassist) and put it in a java file and then compile it works perfectly.

            We tried to disassemble the byte code. There is some byte code, which is not available. also the Jad for decompiling is giving errors like 'invalid stack height
            ERROR: Invalid stack at 19270
            ERROR: Invalid stack at 19791

            Thansks and Regards
            Kiran

            • 3. Re: Problem with Verify Error Inconsistent stack height 0 !=
              kiranlal

              The Problem does not come in javassist 2.6. it is coming in javassist 3.0 only...