英文:
Stack map does not match the one at exception handler - Spring Boot
问题
请注意,以下是您提供的内容的中文翻译:
我的SpringBoot应用程序返回了下面列出的错误。Spring BootRun正常运行。然而,当我在Intellij中启动应用程序或在Jenkins Pipeline中启动应用程序时,我看到了下面的错误。我正在使用JDK 11。可能的问题是什么,我需要查看哪些方面?
由于 java.lang.VerifyError: 栈映射与异常处理程序 10 处的栈映射不匹配
异常详细信息:
位置:
com/controller/MyController$$EnhancerBySpringCGLIB$$1e317dee.<init>(Lcom/service/MyService;)V @10:athrow
原因:
当前帧的标志不可分配给栈映射帧的标志。
当前帧:
bci:@0
标志:{ flagThisUninit }
局部变量:{ uninitializedThis, 'com/service/MyService' }
栈:{ 'java/lang/RuntimeException' }
栈映射帧:
bci:@10
标志:{ }
局部变量:{ top, 'com/service/MyService' }
栈:{ 'java/lang/Throwable' }
字节码:
0000000: 2a59 2bb7 015e b800 38b1 bfbb 004e 5a5f
0000010: b700 51bf
异常处理程序表:
bci [0, 10] => 处理程序:10
bci [0, 10] => 处理程序:10
bci [0, 10] => 处理程序:11
栈映射表:
full_frame(@10,{Top,Object[#352]},{Object[#76]})
same_locals_1_stack_item_frame(@11,Object[#76])
英文:
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])
答案1
得分: 1
我面对了相同的问题。
来自 https://stackoverflow.com/questions/59502419/java-lang-verifyerror-stack-map-does-not-match-the-one-at-exception-handle 的回答帮助我解决了这个问题。
简而言之,我在 spring-aop
依赖中遇到了冲突。
所以:
- 我在
pom.xml
中添加了插件来查找冲突的依赖:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<configuration>
<rules><dependencyConvergence/></rules>
</configuration>
</plugin>
- 运行
mvn enforcer:enforce
并得到以下结果:
[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
这里有两个不同的版本 - 4.3.9 和 5.3.9。
- 添加了严格版本为 5.3.9 的依赖,问题得到解决:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>5.3.9</version>
</dependency>
英文:
I faced with the same problem.
Answer from https://stackoverflow.com/questions/59502419/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>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论