• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Aspect with Annotation error

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutParser.java:302)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(AspectJExpressionPointcut.java:197)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch(AspectJExpressionPointcut.java:184)
at org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter(AspectJExpressionPointcut.java:165)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:189)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:244)
at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:278)
...

Any help?
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Mark
 
dhaval nagar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic