在 Java 7 中使用 AspectJ AOP 时出错 [英] Error when using AspectJ AOP with Java 7

查看:32
本文介绍了在 Java 7 中使用 AspectJ AOP 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I've updated Java to version "1.7.0_09-icedtea" (previously it was 1.6) and get the following message:

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

Application had been compiled with java 1.6 and compiler compliance level was set to 1.6 as well. I'm using spring 3.1.0

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

Has anyone been able to get aspectj working under Java 7?

推荐答案

AspectJ 1.5.4 并非设计为与 Java7 一起使用.尝试将您的 AspectJ 版本升级到 1.7.0 或更高版本(在撰写本文时最新版本为 1.7.2).

AspectJ 1.5.4 is not designed to work with Java7. Try upgrading your version of AspectJ to 1.7.0 or higher (latest was 1.7.2 as of this writing).

(我有 AspectJ/Java7 问题之前也是)

这篇关于在 Java 7 中使用 AspectJ AOP 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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