Results 1 to 5 of 5

Thread: annotation problem with Pointcut in Logger

Hybrid View

  1. #1

    Default annotation problem with Pointcut in Logger

    Hi
    I have used a logger class with below snippet.
    @Pointcut("execution(* com.wqe.aaf.asas.*.*.*(..)) ")
    public void methodPointCut() {

    }

    @Before("methodPointCut()"
    and so on.



    but it is giving below exception.

    java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut methodPointCut
    at org.aspectj.weaver.tools.PointcutParser.parsePoint cutExpression(PointcutParser.java:315)
    at org.springframework.aop.aspectj.AspectJExpressionP ointcut.buildPointcutExpression(AspectJExpressionP ointcut.java:195)
    at org.springframework.aop.aspectj.AspectJExpressionP ointcut.checkReadyToMatch(AspectJExpressionPointcu t.java:181)
    at org.springframework.aop.aspectj.AspectJExpressionP ointcut.getClassFilter(AspectJExpressionPointcut.j ava:162)


    I have annotation jar in lib with names hibernate-commons-annotations.jar,hibernate-annotations.jar and hibernate-commons-annotations.3.2.0.Beta1.jar,ehcache-spring-annotations-1.1.3.jar.

    Are these hibernate jars creating conflict with spring annotation?


    Please help in this regard.

  2. #2
    Join Date
    Jul 2010
    Location
    Venice, Italy
    Posts
    710

    Default

    No the problem is you must specify package and class of pointcut method when you use it in the @Before:

    Code:
    @Before("com.mypackage.MyPointcutClass.methodPointCut()")
    otherwise pointcut method is not found and its @Pointcut annotation can't be processed using reflection.

  3. #3

    Default

    tried the same u mentioned but getting the same exception.error at ::0 can't find referenced pointcut methodPointCut

  4. #4
    Join Date
    Jul 2010
    Location
    Venice, Italy
    Posts
    710

    Default

    hmmm you should post your Spring config and aspect class code (remember to use the [ CODE] tags!)

  5. #5

    Default

    thank you a lot for trying, and i am glad to share the problem is resolved.
    it was the problem with jars i used for aspect
    i replaced aspectjweaver-1.5.2.jar and aspectjrt-1.1.1.jar with
    aspectjweaver.jar and aspectjrt.jar.
    Sorry for being lazy to identify which jar was faulty...
    but i got a great relief
    thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •