java.lang.VerifyError: Expecting a stackmap frame at branch target 25

首先,看下jdk中对于verifyError的解释:
Thrown when the "verifier" detects that a class file, though well formed, contains some sort of internal inconsistency or security problem.
翻译:当“校验器”检测到一个类文件虽然格式正确,但包含着一些内部不一致性或安全性问题时,抛出该错误。
堆栈信息:

java.lang.VerifyError: Expecting a stackmap frame at branch target 25
Exception Details:
  Location:
    controllers/TestRunner.index()V @7: ifne
  Reason:
    Expected stackmap frame at this location.
  Bytecode:
    0x0000000: b802 3300 b801 fd9a 0012 1301 ff03 bd00
    0x0000010: 54b8 0202 a701 3000 bfb8 0205 b800 2f59
    0x0000020: 4e13 0230 2db8 022d 00c6 0068 2db4 0033
    0x0000030: 9900 612d b600 37aa 0000 005a 0000 0000
    0x0000040: 0000 0003 0000 001d 0000 0020 0000 002b
    0x0000050: 0000 003e a700 3d2d b600 3bc0 003d 4ba7
    0x0000060: 004b 2db6 003b c000 3d4c 2db6 003b c000
    0x0000070: 3d4b a700 5d2d b600 3bc0 003d 4d2d b600
    0x0000080: 3bc0 003d 4c2d b600 3bc0 003d 4b01 a700
    0x0000090: 82b8 0041 2dc6 0014 2db4 0044 9900 0d57
    0x00000a0: 2d10 00b6 0048 a700 9e4b 1302 272a b802
    0x00000b0: 2db8 004b 2dc6 0019 2db4 0044 9900 1257
    0x00000c0: 2d2a b600 4f2d 1001 b600 48a7 0079 4c13
    0x00000d0: 022e 2bb8 022d b800 522d c600 1e2d b400
    0x00000e0: 4499 0017 572d 2ab6 004f 2d2b b600 4f2d
    0x00000f0: 1002 b600 48a7 004f 4d13 022f 2cb8 022d
    0x0000100: 06bd 0054 5903 2a53 5904 2b53 5905 2c53
    0x0000110: b800 582d c600 222d b400 4499 001b 2d2a
    0x0000120: b600 4f2d 2bb6 004f 2d2c b600 4f2d 1003
    0x0000130: b600 48a7 0011 a700 0e3a 0601 3a05 b802
    0x0000140: 3619 06bf 013a 05b8 0236 b1            
  Exception Handler Table:
    bci [0, 313] => handler: 313
  Stackmap Table:
    same_locals_1_stack_item_frame(@23,Object[#568])
    full_frame(@84,{Top,Top,Top,Object[#43]},{})
    same_frame(@87)
    same_frame(@98)
    same_frame(@117)
    same_frame(@145)
    same_locals_1_stack_item_frame(@169,Object[#61])
    full_frame(@170,{Object[#61],Top,Top,Object[#43]},{})
    same_locals_1_stack_item_frame(@206,Object[#61])
    full_frame(@207,{Object[#61],Object[#61],Top,Object[#43]},{})
    same_locals_1_stack_item_frame(@248,Object[#61])
    full_frame(@272,{Object[#61],Object[#61],Object[#61],Object[#43]},{Object[#98]})
    same_frame(@310)
    full_frame(@313,{},{Object[#568]})
    same_frame(@324)

    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
    at java.lang.Class.getDeclaredFields(Class.java:1916)
    at jobs.Bootstrap.controllerInject(Bootstrap.java:30)
    at jobs.Bootstrap.doJob(Bootstrap.java:20)

解决:设置jvm参数,jdk1.7添加XX:-UseSplitVerifier,jdk1.8添加-noverify。这个解决办法是我Google到的,我遇到的问题成功解决,但是我觉得这应该只是治标不治本的方法,如果有更好的解决方法,欢迎留言告知。

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值