java.lang.VerifyError: Bad return type Exception Details: Location: btrace/test/verifyError/Persons.getPerson(Ljava/lang/String;)Lbtrace/test/verifyError/Person; @56: areturn Reason: Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'btrace/test/verifyError/Person' (from method signature) Current Frame: bci: @56 flags: { } locals: { 'btrace/test/verifyError/Persons', 'java/lang/String', long, long_2nd, long, long_2nd, 'java/lang/Object' } stack: { 'java/lang/Object' } Bytecode: 0000000: 1400 1041 b800 1737 0412 21b8 000f bb00 0000010: 2359 2bb7 0025 3a06 2bb6 002b 9a00 0dbb 0000020: 002d 592b b700 2e3a 0619 06b8 0017 1604 0000030: 6541 1221 20b8 001b b0 Stackmap Table: append_frame(@41,Long,Long,Object[#4])


Solutions on the web1

Solution icon of github
' } Bytecode: 0000000: 1400 1041 b800 1737 0412 21b8 000f bb00 0000010: 2359 2bb7 0025 3a06 2bb6 002b 9a00 0dbb 0000020: 002d 592b b700 2e3a 0619 06b8 0017 1604 0000030: 6541 1221 20b8 001b b0 Stackmap Table: append_frame(@41,Long,Long,Object[#4])

Stack trace

java.lang.VerifyError: Bad return type
Exception Details:
  Location:
    btrace/test/verifyError/Persons.getPerson(Ljava/lang/String;)Lbtrace/test/verifyError/Person; @56: areturn
  Reason:
    Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'btrace/test/verifyError/Person' (from method signature)
  Current Frame:
    bci: @56
    flags: { }
    locals: { 'btrace/test/verifyError/Persons', 'java/lang/String', long, long_2nd, long, long_2nd, 'java/lang/Object' }
    stack: { 'java/lang/Object' }
  Bytecode:
    0000000: 1400 1041 b800 1737 0412 21b8 000f bb00
    0000010: 2359 2bb7 0025 3a06 2bb6 002b 9a00 0dbb
    0000020: 002d 592b b700 2e3a 0619 06b8 0017 1604
    0000030: 6541 1221 20b8 001b b0                 
  Stackmap Table:
    append_frame(@41,Long,Long,Object[#4])
	at btrace.test.verifyError.Main.<init>(Main.java:9)
	at btrace.test.verifyError.Main.main(Main.java:14)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.