Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] (no subject)

Sorry for the lengh of this post !
I create an abstract Aspect like this :

package iep.perf;

import java.util.Calendar;

public abstract aspect AbstractDurationMethod {
   private static String rootTrace = "";

   private static Trace outDurationMethods;
   static {
       rootTrace = System.getProperty("rootTrace");

       outDurationMethods = new Trace(rootTrace + File.separator
               + "outDurationMethods.log");

   public abstract pointcut methods();

   Object around(): methods() {
       long deb = Calendar.getInstance().getTimeInMillis();
       Object retour= proceed();
       long fin = Calendar.getInstance().getTimeInMillis();
               + ";JointPoint ="
               + thisJoinPoint.getSignature().getDeclaringTypeName()
               + "."
               + thisJoinPoint.getSignature().getName()
               + ";duration="
               + (fin - deb) + " ms\n");
       return retour;


I use classes Square and Circle found in eclipse documentation to test my aspects

When i try this aspect with concrete-aspect tag in aop.xml :

<concrete-aspect name="iep.perf.DurationMethod"
           <pointcut name="methods"
               _expression_="within(jlp.exemple1.*) &amp;&amp;  call (public * jlp..*(..))" />

I get this error :
Exception in thread "main" java.lang.IllegalAccessError: tried to access method
02c33proceed(Lorg/aspectj/runtime/internal/AroundClosure;)Ljava/lang/Object; fro
m class jlp.exemple1.Main
       at jlp.exemple1.Main.perimeter_aroundBody1$advice(
       at jlp.exemple1.Main.perimeter_aroundBody2(
       at jlp.exemple1.Main$
       at iep.perf.AbstractDurationMethod.ajc$around$iep_perf_AbstractDurationMethod$1$cd102c33proceed(AbstractDurationMethod.aj:1)
       at iep.perf.AbstractDurationMethod.ajc$around$iep_perf_AbstractDurationMethod$1$cd102c33(AbstractDurationMethod.aj:24)
       at jlp.exemple1.Main.main(

When I extend my Abstract Aspect like this :
package iep.perf;

public aspect ConcreteDurationMethod extends AbstractDurationMethod {

   public pointcut methods():within(jlp.exemple1.*) &&  call (public * jlp..*(..));


and modify my aop.xml like below :
<aspect name="iep.perf.ConcreteCounterInstances"/>
it runs fine !
But that i want is to use concrete-aspect tag.
I use AspectJ 1.5.4 embedded in Eclipse Europa 3.3.1  Build id: M20070921-1145

Do you think that is a bug, or otherwise what did i miss ?

Back to the top