3 Replies Latest reply on Sep 5, 2005 5:33 AM by Kabir Khan

    pointcut $instanceof didn't work

    N Sharma Newbie


      I have written a pointcut to intercept the Exception.

      My jboss-aop.xml looks like this:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
       <aspect class="com.ac.detector.ExceptionHandlingAspect" scope="PER_INSTANCE"/>
       <bind pointcut="call(* $instanceof{java.lang.Exception}-&gt;*(..))">
       <advice aspect="com.ac.detector.ExceptionHandlingAspect" name="catchException"/>

      In my source file (which is a servlet), I have created an Exception object and calling a method on it...But it never gets intercepted. I am doing compile time weaving and then deploying it in jboss app server.

      I even tried by trying pointcut="execution(* $instanceof{java.lang.Exception}->*(..))" ...but no luck....

      Is this pointcut correct??? OR can some one give me some idea how can I define pointcut for method call on an Exception object????