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

java.lang.VerifyError: 
Expecting a stackmap frame at branch target 51
Exception Details:
  Location:
    com/suning/ospos/pushapi/controller/PushAuthController.$jacocoInit()[Z @4: ifnonnull
  Reason:
    Expected stackmap frame at this location.
  Bytecode:
    0000000: b200 a259 c700 2f57 b200 a806 bd00 aa59
    0000010: 0314 00ab b800 b153 5904 12b2 5359 0510
    0000020: 28b8 00b7 535a b600 ba57 0332 c000 bb59
    0000030: b300 a2b0                              

背景:

java源代码是用jdk1.6下开发的,后来环境上替换安装了jdk1.7编译运行。运行报错!!!

解决方法:

在eclipse中给jdk设置参数:-XX:-UseSplitVerifier

Preferences->Java->Installed JREs->双击选择的jdk,在弹出对话框的Default vm arguments输入:-XX:-UseSplitVerifier


如果是LINUX 服务:
修改catalina.sh 加上
JAVA_OPTS= -XX:-UseSplitVerifier

windows:

修改catalina.bat

set JAVA_OPTS= -XX:-UseSplitVerifier


如果是 surfire 单元测试:

[html]  view plain  copy
  1. <plugin>  
  2.                 <groupId>org.apache.maven.plugins</groupId>  
  3.                 <artifactId>maven-surefire-plugin</artifactId>  
  4.                 <version>2.19</version>  
  5.                 <configuration>  
  6.                     <includes>  
  7.                         <include>**/*Test.java</include>  
  8.                     </includes>  
  9.                     <excludes>  
  10.                         <exclude>**/*IntegrationTest.java</exclude>  
  11.                     </excludes>  
  12.                     <argLine>${argLine} -server -XX:PermSize=512m -XX:MaxNewSize=1024m -XX:-UseSplitVerifier</argLine>  
  13.                 </configuration>  
  14.                 <dependencies>  
  15.                     <dependency>  
  16.                         <groupId>org.apache.maven.surefire</groupId>  
  17.                         <artifactId>surefire-junit47</artifactId>  
  18.                         <version>2.19</version>  
  19.                     </dependency>  
  20.                 </dependencies>  
  21.             </plugin>  

猜你喜欢

转载自blog.csdn.net/suchahaerkang/article/details/80679162