Announcement Announcement Module
Collapse
No announcement yet.
annotation problem with Pointcut in Logger Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment


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

      Comment


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

        Comment


        • #5
          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

          Comment

          Working...
          X