java.lang.VerifyError:堆栈映射与异常句柄中的不匹配 [英] java.lang.VerifyError: Stack map does not match the one at exception handle

查看:74
本文介绍了java.lang.VerifyError:堆栈映射与异常句柄中的不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我为 testcontroller 实现方面时,我在启动 springboot 应用程序时遇到以下异常

I got below exception when starting springboot application, when I implement aspect for testcontroller

org.springframework.beans.factory.BeanCreationException:错误创建名为testController"的 bean 在文件中定义[build\classes\java\main\com\nijil\fetch\service\identity\TestController.class]:bean 初始化失败;嵌套异常是 org.springframework.aop.framework.AopConfigException: Unexpected AOP例外;嵌套异常是 java.lang.IllegalStateException: Unable加载缓存项

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testController' defined in file [build\classes\java\main\com\nijil\fetch\service\identity\TestController.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is java.lang.IllegalStateException: Unable to load cache item

由以下原因引起:java.lang.VerifyError:堆栈映射与异常处理程序 9 中的堆栈映射不匹配异常详情:地点:com/nijil/fetch/service/identity/TestController$$EnhancerBySpringCGLIB$$a04bb642.()V @9: athrow原因:当前帧的标志不可分配给堆栈地图帧.

Caused by: java.lang.VerifyError: Stack map does not match the one at exception handler 9 Exception Details: Location: com/nijil/fetch/service/identity/TestController$$EnhancerBySpringCGLIB$$a04bb642.()V @9: athrow Reason: Current frame's flags are not assignable to stack map frame's.

推荐答案

不确定这是确切的答案,但就我而言,这是解决方案.

Not Sure this is exact answer, but in my case this was the solution.

我正在使用 aspect4j 尝试一些 AOP 功能,并且添加了 spring-aop 依赖

I was trying some AOP functions by using aspect4j and I had added spring-aop dependency

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aop</artifactId>
    <version>5.0.1.RELEASE</version>
    <scope>compile</scope>
</dependency>

到 pom 文件,应用程序通过 STS 工作正常,但是当我要部署到服务器时,出现了上述异常.

to pom file and the application is working fine through STS, But when I'm going to deploy to the server above exception was came.

所以最后我从 pom 中删除了上面的spring-aop"依赖项,并且在将应用程序作为 jar 运行时一切顺利,没有任何错误或异常.

So finally I removed the above 'spring-aop' dependency from the pom and all went fine without any error or exceptions in running the applications as a jar.

我认为 spring-aop 版本 5.0.1.RELEASE 与 Spring Boot 版本 2.3.0.RELEASE 会有一些不兼容(在我的情况下).

I think there will be some incompatibilities with spring-aop version 5.0.1.RELEASE with the spring boot version 2.3.0.RELEASE (in my situation).

这篇关于java.lang.VerifyError:堆栈映射与异常句柄中的不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆