gpt4 book ai didi

spring - 在 Java 7 中使用 AspectJ AOP 时出错

转载 作者:IT老高 更新时间:2023-10-28 13:48:04 25 4
gpt4 key购买 nike

我已将 Java 更新到版本“1.7.0_09-icedtea”(之前是 1.6)并收到以下消息:

Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate be
an class [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: error the
@annotation pointcut expression is only supported at Java 5 compliance level or above

应用程序已使用 java 1.6 编译,并且编译器合规级别也设置为 1.6。我正在使用 spring 3.1.0

有没有人能够让 aspectj 在 Java 7 下工作?

最佳答案

AspectJ 1.5.4 不是为与 Java7 一起工作而设计的。尝试将您的 AspectJ 版本升级到 1.7.0 或更高版本(在撰写本文时最新版本为 1.7.2)。

(我之前也有AspectJ/Java7 issues)

关于spring - 在 Java 7 中使用 AspectJ AOP 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15678417/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com