天天看点

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 单元测试:

<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.19</version>
				<configuration>
					<includes>
						<include>**/*Test.java</include>
					</includes>
					<excludes>
						<exclude>**/*IntegrationTest.java</exclude>
					</excludes>
					<argLine>${argLine} -server -XX:PermSize=512m -XX:MaxNewSize=1024m -XX:-UseSplitVerifier</argLine>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.surefire</groupId>
						<artifactId>surefire-junit47</artifactId>
						<version>2.19</version>
					</dependency>
				</dependencies>
			</plugin>