File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Aspect with Annotation error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Aspect with Annotation error" Watch "Aspect with Annotation error" New topic

Aspect with Annotation error

dhaval nagar

Joined: Oct 20, 2008
Posts: 11
I have an aspect configured for several method for some backend processes.
Now methods are getting increased with diverse package names.
I want to configure my aspect for a specific annotation which i can decorate to all the target methods.

I am using NetBeans 6.7.1, JDK 6, Spring 3.0 and AspectJ 1.6.5. I have set my aspect like this:

@Around("@annotation (com.myorg.ServiceMethod)")

When i try to run the application it shows me this error:

Caused by: java.lang.IllegalArgumentException: error the @annotation pointcut expression is only supported at Java 5 compliance level or above
at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(
at org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch(
at org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter(

Any help?
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17271

Stupid question here, but what are you running it in. I mean I see you are developing in Netbeans, but at runtime are you running a server inside Netbeans, or a standalone server where that standalone server might not be using Java 5?

Just a wild guess.


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
dhaval nagar

Joined: Oct 20, 2008
Posts: 11
Mark, how it is a stupid question?

I am not running any server. It is a simple standalone javase app which gives me error while loading the spring-config file.
I posted the error only after modifing the ant (build.xml) script to make source level 1.5.

Mark i am facing a problem.
I posed it here because i am using Spring AOP.
I agree. Here's the link:
subject: Aspect with Annotation error
It's not a secret anymore!