2 Replies Latest reply on Oct 14, 2005 6:07 PM by Charles Abreu

    Exception on call pointcut

    Charles Abreu Newbie

      I've been happy using "execution" pointcuts for a while, now when I try to introduce a "call" pointcut on a class, I get an exception. The code works well if I keep a "execution" pointcut instead. I'm using Jre1.5 and JBoss AOP 1.3 and the problem seems to happen with both precompile and loadtime instrumentation. Is there any especial, maybe obvious, care in switching from execution to call pointcuts? Sorry, but I'm not aware of anything other special with my classes and enviroment to help here.

      thank's in advance

      Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: for class: xxx.xxx.MyCalledClass
       at org.jboss.aop.ClassAdvisor.resolveCallerMethodInfo(ClassAdvisor.java:1307)
       at xxx.xxx.MyCallerClass.<clinit>(MyCallerClass.java)
       ... 25 more
      Caused by: java.lang.RuntimeException: java.lang.RuntimeException: for class: xxx.xxx.MyCalledClass
       at org.jboss.aop.pointcut.CallMatcher.visit(CallMatcher.java:60)
       at org.jboss.aop.pointcut.ast.ASTCall.jjtAccept(ASTCall.java:21)
       at org.jboss.aop.pointcut.MatcherHelper.visit(MatcherHelper.java:73)
       at org.jboss.aop.pointcut.MatcherHelper.matches(MatcherHelper.java:68)
       at org.jboss.aop.pointcut.PointcutExpression.matchesCall(PointcutExpression.java:205)
       at org.jboss.aop.ClassAdvisor.resolveCallerMethodInfo(ClassAdvisor.java:1293)
       ... 26 more
      Caused by: java.lang.RuntimeException: for class: xxx.xxx.MyCalledClass
       at org.jboss.aop.AspectManager.getTempClassAdvisorIfNotExist(AspectManager.java:934)
       at org.jboss.aop.pointcut.CallMatcher.visit(CallMatcher.java:53)
       ... 31 more
      Caused by: java.lang.NoSuchFieldException: aop$classAdvisor$aop
       at java.lang.Class.getDeclaredField(Class.java:1854)
       at org.jboss.aop.AspectManager.getTempClassAdvisorIfNotExist(AspectManager.java:928)
       ... 32 more
      


        • 1. Re: Exception on call pointcut
          Kabir Khan Master

          Hmm, it should work. Do you have a simple code example demonstrating the behaviour?

          • 2. Re: Exception on call pointcut
            Charles Abreu Newbie

            The (not so obvious to me) problem is that I was using MethodInvocation where I should use MethodCalledByMethodInvocation in advice declararion parameter. But now I'm having a new problem. If I switch from execution to call pointcuts an exception is thrown from the constructor of the calling class if the class has a superclass wich gets the same advice binding (it calls the method too but not inside constructor).

            Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: for class: xxx.xxx.SUF
             at org.jboss.aop.ClassAdvisor.resolveCallerMethodInfo(ClassAdvisor.java:1311)
             at xxx.xxx.CadastroUF.<clinit>(CadastroUF.java)
             ... 25 more
            Caused by: java.lang.RuntimeException: java.lang.RuntimeException: for class: xxx.xxx.SUF
             at org.jboss.aop.pointcut.CallMatcher.visit(CallMatcher.java:60)
             at org.jboss.aop.pointcut.ast.ASTCall.jjtAccept(ASTCall.java:21)
             at org.jboss.aop.pointcut.MatcherHelper.visit(MatcherHelper.java:77)
             at org.jboss.aop.pointcut.MatcherHelper.matches(MatcherHelper.java:72)
             at org.jboss.aop.pointcut.PointcutExpression.matchesCall(PointcutExpression.java:209)
             at org.jboss.aop.ClassAdvisor.resolveCallerMethodInfo(ClassAdvisor.java:1297)
             ... 26 more
            Caused by: java.lang.RuntimeException: for class: xxx.xxx.SUF
             at org.jboss.aop.AspectManager.getTempClassAdvisorIfNotExist(AspectManager.java:984)
             at org.jboss.aop.pointcut.CallMatcher.visit(CallMatcher.java:53)
             ... 31 more
            Caused by: java.lang.NoSuchFieldException: aop$classAdvisor$aop
             at java.lang.Class.getDeclaredField(Class.java:1854)
             at org.jboss.aop.AspectManager.getTempClassAdvisorIfNotExist(AspectManager.java:978)
             ... 32 more