Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Duplicate entries in logging in AspectJ

The second variant of your pointcut will not match on subpackages,
that is the only difference amongst the three you are trying.  Varying
that is unlikely to affect your duplication.

Duplication can be for a couple of reasons:
- you have duplicate advice attached to the same pointcut
- you are compile time weaving and also loadtime weaving (with
overweaving switched on)
- test() calls itself (or something else that in turn calls test()
again) and you aren't using cflow() to avoid logging the nested
execution.
- you have some other pointcut and you don't realise it is also
matching the same thing.

Have you tried switching on showWeaveInfo to show you what is causing
methods to be matched multiple times?  Either via -showWeaveInfo on
the command line or in the weaver options section of an aop.xml file.

cheers,
Andy

On 9 August 2012 02:28, Romain Muller <romain.muller@xxxxxxxxx> wrote:
> What does the advise(s) look like?
>
> -Romain.
>
> Le 9 août 2012 à 11:18, Jeevitha Muthusamy a écrit :
>
> Hi,
>     We are using AspectJ to log the trace of our API execution.
>     When enabling Aspects we receive duplicate entries of messages.
>     We are not using any framework or annotations.
>
>   Herewith I have given the sample Pointcut we used to trace method
> exceution :
>
>    pointcut test():
>         execution(* com.test.mail..*.*(..));
>
>    pointcut test1():
>         execution(* com.test.mail.*.*(..));
>
>
> pointcut test1():
>         execution(* com.test.mail..*(..));
>
> We used the three versions but we receive only duplicate entries.
>
> Sample Log Message:
>         Invoking method   test.....
>         Invoking method   test.....
>         Returning from method test....
>         Returning from method test....
>
> Please let me know how to resolve this issue!!
>
> Regards,
> Jeevitha
>
>
>
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top