java.lang.VerifyError 在使用PowerMock EasyMock进行单元測试

java.lang.VerifyError:Stack map does not match the one at exception handler 385 in method ... at offset 377

我使用的 jar包( 以下是觉得跟这个问题有关系的jar包)例如以下:

antrl-3.3-complete.jar

cglib-2.2.jar

cglib-nodep-2.2.2.jar

easymock-3.2.jar

mockito-all-1.9.5.jar

persistent-testtool.jar

powermock-easymock-1.5.4-full.jar

pwoermock-mockito-1.5.4-full.jar

javassist-3.17.1-GA.jar

问题出在javassist-3.17.1-GA.jar包上 。 把它从classpath中去掉,并增加javassist-3.18.1-GA.jar

參考资料:

http://stackoverflow.com/questions/15122890/java-lang-verifyerror-expecting-a-stackmap-frame-at-branch-target-jdk-1-7

http://stackoverflow.com/questions/15253173/how-safe-is-it-to-use-xx-usesplitverifier

https://code.google.com/p/powermock/issues/detail?id=355(这里面有提到可能是javassist 包的问题)

http://stackoverflow.com/questions/100107/reasons-of-getting-a-java-lang-verifyerror

原文地址:https://www.cnblogs.com/wgwyanfs/p/6951121.html