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

查看:124
本文介绍了在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天全站免登陆