Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

spring - Error when using AspectJ AOP with Java 7

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

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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).

(I had AspectJ/Java7 issues before, too)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...