环境
jdk:1.7
play framework:1.2.7
前言
最近要改一个web
项目;像往常一样,去gitlab中去拉取项目;
之后执行play eclipsify
生成eclipse
项目的格式,之后导入;
在之后,就是启动项目,并且访问localhost:9998
,结果就报错:
Oops: VerifyError
An unexpected error occured caused by exception VerifyError: Expecting a stack map frame Exception Details: Location: controllers/adminManagement/Secure$Security.authentify(Ljava/lang/String;Ljava/lang/String;)Z @33: istore_3 Reason: Error exists in the bytecode Bytecode: 0000000: b800 7d12 782b b800 7a12 712a b800 77bb 0000010: 0010 59b7 0012 bf3a 0403 3eb8 0080 1904 0000020: bf3e b800 821d ac Exception Handler Table: bci [0, 23] => handler: 23 Stackmap Table: same_locals_1_stack_item_frame(@23,Object[#55])
play.exceptions.UnexpectedException: Unexpected Error
at play.Invoker$Invocation.onException(Invoker.java:244)
at play.Invoker$Invocation.run(Invoker.java:286)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.VerifyError: Expecting a stack map frame
Exception Details:
Location:
controllers/adminManagement/Secure$Security.authentify(Ljava/lang/String;Ljava/lang/String;)Z @33: istore_3
Reason:
Error exists in the bytecode
Bytecode:
0000000: b800 7d12 782b b800 7a12 712a b800 77bb
0000010: 0010 59b7 0012 bf3a 0403 3eb8 0080 1904
0000020: bf3e b800 821d ac
Exception Handler Table:
bci [0, 23] => handler: 23
Stackmap Table:
same_locals_1_stack_item_frame(@23,Object[#55])
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.getDeclaredMethods(Class.java:1855)
at play.utils.JavaWithCaching.findAllAnnotatedMethods(Java.java:528)
at play.utils.JavaWithCaching.findAllAnnotatedMethods(Java.java:535)
at play.utils.JavaWithCaching.findAllAnnotatedMethods(Java.java:498)
at play.utils.Java.findAllAnnotatedMethods(Java.java:277)
at play.mvc.ActionInvoker.handleFinallies(ActionInvoker.java:390)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:263)
... 1 more
解决方法
经过查询是因为 Any tool that modifies bytecode in a version 51 classfile must be sure to update the stackmap information to be consistent with the bytecode in order to pass verification.
中文意思就是: JDK7 引入版本为51的字节码规范,使用了严格的类型检查器,任何工具修改了字节码的,都需要更新stackmap,但是jws修改了字节码,而没有更新
解决方法:启动参数添加 -XX:-UseSplitVerifier
具体放置位置参考这篇,讲解java7、8添加的参数:java.lang.VerifyError: Expecting a stack map frame
参考地址: