堆栈映射与异常处理程序中的堆栈映射不匹配 - Spring 启动

Stack map does not match the one at exception handler - Spring Boot

我的Spring启动应用返回下面列出的错误。 Spring BootRun 工作正常。但是,当我在 Intellij 或 Jenkins Pipeline 中启动应用程序时,我看到以下错误。我正在使用 JDK 11.What 可能是我可能需要考虑的潜在问题?

Caused by: java.lang.VerifyError: Stack map does not match the one at exception handler 10
Exception Details:
  Location:
    com/controller/MyController$$EnhancerBySpringCGLIB$e317dee.<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])

我遇到了同样的问题。

来自java.lang.VerifyError: Stack map does not match the one at exception handle的回答 帮我解决了问题。

简而言之,我在 spring-aop 依赖方面有冲突。 所以:

  1. 我将插件添加到 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>
  1. 运行 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。

  1. 添加了对严格版本 5.3.9 的依赖,这很有帮助
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aop</artifactId>
    <version>5.3.9</version>
</dependency>