Issue
My SpringBoot app is returning the error listed below. Spring BootRun works fine. However when I start the application in Intellij or in Jenkins Pipeline , I see the error below. I am using JDK 11.What could be the potential issue that I may have to look at?
Caused by: java.lang.VerifyError: Stack map does not match the one at exception handler 10
Exception Details:
Location:
com/controller/MyController$$EnhancerBySpringCGLIB$$1e317dee.<init>(Lcom/service/MyService;)V @10: athrow
Reason:
Current frame's flags are not assignable to stack map frame's.
Current Frame:
bci: @0
flags: { flagThisUninit }
locals: { uninitializedThis, 'com/service/MyService' }
stack: { 'java/lang/RuntimeException' }
Stackmap Frame:
bci: @10
flags: { }
locals: { top, 'com/service/MyService' }
stack: { 'java/lang/Throwable' }
Bytecode:
0000000: 2a59 2bb7 015e b800 38b1 bfbb 004e 5a5f
0000010: b700 51bf
Exception Handler Table:
bci [0, 10] => handler: 10
bci [0, 10] => handler: 10
bci [0, 10] => handler: 11
Stackmap Table:
full_frame(@10,{Top,Object[#352]},{Object[#76]})
same_locals_1_stack_item_frame(@11,Object[#76])
Solution
I faced with the same problem.
Answer from java.lang.VerifyError: Stack map does not match the one at exception handle helped me to solve the problem.
In short I had a conflict in spring-aop
dependency.
So:
- I added plugin into
pom.xml
to find a conflict dependency:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<configuration>
<rules><dependencyConvergence/></rules>
</configuration>
</plugin>
- run
mvn enforcer:enforce
and got
[WARNING]
Dependency convergence error for org.springframework:spring-aop:5.3.9 paths to dependency are:
+-com.syniverse.imn-webcore:soapfe:9.0.1
+-org.springframework.boot:spring-boot-starter-web:2.5.3
+-org.springframework:spring-webmvc:5.3.9
+-org.springframework:spring-aop:5.3.9
and
+-com.syniverse.imn-webcore:soapfe:9.0.1
+-org.springframework.boot:spring-boot-starter-security:1.5.8.RELEASE
+-org.springframework.security:spring-security-config:4.2.3.RELEASE
+-org.springframework:spring-aop:4.3.9.RELEASE
Here are two different version - 4.3.9 and 5.3.9.
- Added dependency with strict version 5.3.9 and it helped
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>5.3.9</version>
</dependency>
Answered By - user3607130
Answer Checked By - David Goodson (JavaFixing Volunteer)