Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] How can I exclude class's in aspectJ pointcuts

Ok now when I look at the logs ( in eclipse ) 
I can see the aspectj visiting other packages in the application even so

I told it to visit only the ones under com.foo.test
What can be wrong in our pointcut ?

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Meir Yanovich
Sent: Tuesday, November 27, 2007 6:08 PM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] How can I exclude class's in aspectJ
pointcuts

Ok the aspect file is in other package in com.foo.config
I added also the 
&& !within(AspectSecurity)
&& !within(com.foo.config.*);

And still getting StackOverflowError
Im testing the methods with junit tester that using one of the get's 
What else can it be ? 

Thanks allot for your help 

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andy Clement
Sent: Tuesday, November 27, 2007 6:01 PM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] How can I exclude class's in aspectJ
pointcuts

StackOverflowError usually means you are advising yourself.  What
package is your aspect in?
Is it in a package you are excluding with your within clauses?  If you
don't exclude the aspect and it contains methods called get* or set*
then you will self-advise and crash.

Andy.

On 27/11/2007, Meir Yanovich <meiry@xxxxxxxxxxxx> wrote:
> Ok im getting somewhere now .. im not getting the exception
> But it seams there is somewhere recursion happening.. and im getting
> java.lang.StackOverflowError
> >From different package from com.foo.helpers.queryHelper it keeps
> visiting it.
> Even if I add to your pointcut something like this :
> execution(* get*(..)) || execution(* set*(..))) &&
> within(com.foo.test..*) && !within(com.foo.test.security.*)&&
> !within(com.foo.helpers.queryHelper.*)
>
>
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andy Clement
> Sent: Tuesday, November 27, 2007 5:41 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: Re: [aspectj-users] How can I exclude class's in aspectJ
> pointcuts
>
> (execution(* get*(..)) || execution(* set*(..))) &&
> within(com.foo.test..*) && !within(com.foo.test.security.*)
>
> On 27/11/2007, Meir Yanovich <meiry@xxxxxxxxxxxx> wrote:
> > Ok maybe I will try different approaches...
> > How can I write pointcut pattern that matches this :
> > Only watch methods that are starting with get or set only under the
> > package:
> > com.foo.test.* AND exclude (don't watch) the package
> > com.foo.test.security.* and all its methods.
> >
> > Thanks for the help
> >
> > -----Original Message-----
> > From: aspectj-users-bounces@xxxxxxxxxxx
> > [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andy Clement
> > Sent: Tuesday, November 27, 2007 5:13 PM
> > To: aspectj-users@xxxxxxxxxxx
> > Subject: Re: [aspectj-users] How can I exclude class's in aspectJ
> > pointcuts
> >
> > So the NPE is occurring at line 54 in your aspect? Without seeing
the
> > code, it sounds like you need to either guard the line that is
> > suffering from a null or find the place that is getting matched
which
> > leads to the null occurring in your advice.  you could do that with
> > something like this in your advice:
> >
> > if (whateverItIs==null) System.err.println("Null after matching
here:
> > "+thisJoinPoint.getSourceLocation());
> >
> > Andy.
> >
> > On 27/11/2007, Meir Yanovich <meiry@xxxxxxxxxxxx> wrote:
> > > Well yes from the what I see I have something like 600+ methods
that
> I
> > > expected , and I don't see any ajcore file...
> > > Also this is java.lang.NullPointerException im getting ..
> > >
> > > -----Original Message-----
> > > From: aspectj-users-bounces@xxxxxxxxxxx
> > > [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andy
Clement
> > > Sent: Tuesday, November 27, 2007 4:38 PM
> > > To: aspectj-users@xxxxxxxxxxx
> > > Subject: Re: [aspectj-users] How can I exclude class's in aspectJ
> > > pointcuts
> > >
> > > what do you mean by stuck trace? is that the only line of output
you
> > > see?  Did weaving all go OK?
> > > If AspectJ crashed during weaving you might see an ajcore file on
> the
> > > disk which would give details of the problem.  If you compile with
> > > -showWeaveInfo are you definetly seeing that it advices only where
> you
> > > expect?
> > >
> > > Andy
> > >
> > > On 27/11/2007, Meir Yanovich <meiry@xxxxxxxxxxxx> wrote:
> > > > No just one time , not recursion . this is stuck trace
> > > >
> > > > -----Original Message-----
> > > > From: aspectj-users-bounces@xxxxxxxxxxx
> > > > [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andy
> Clement
> > > > Sent: Tuesday, November 27, 2007 3:44 PM
> > > > To: aspectj-users@xxxxxxxxxxx
> > > > Subject: Re: [aspectj-users] How can I exclude class's in
aspectJ
> > > > pointcuts
> > > >
> > > > that looks just like one line of a Java stack trace?  Are you
> > getting
> > > > that over and over?  If so that could indicate you have advised
> > > > yourself by accident and are recursing...
> > > >
> > > > Andy.
> > > >
> > > > On 27/11/2007, Meir Yanovich <meiry@xxxxxxxxxxxx> wrote:
> > > > > Hello and thanks for the fast reply I added this.
> > > > > But I still getting error ..
> > > > > My real case is bit more complex then the example I gave.
> > > > > How can I get some kind of error checking from aspectJ or
> somekind
> > > of
> > > > > debug info from aspectJ ?
> > > > > All im getting is :
> > > > > at
> > > > >
> > > >
> > >
> >
>
com.foo.configuration.AspectSecurity.ajc$before$com_foo_configuration_As
> > > > > pectSecurity$1$dbea9d15(AspectSecurity.aj:54)
> > > > >
> > > > > in line 54 I have called method from within my application .
> > > > >
> > > > > -----Original Message-----
> > > > > From: aspectj-users-bounces@xxxxxxxxxxx
> > > > > [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of
> > > > > hermod.opstvedt@xxxxxxxxx
> > > > > Sent: Tuesday, November 27, 2007 2:37 PM
> > > > > To: aspectj-users@xxxxxxxxxxx
> > > > > Subject: RE: [aspectj-users] How can I exclude class's in
> aspectJ
> > > > > pointcuts
> > > > >
> > > > > Hi
> > > > >
> > > > > ...... && !within(com.fo.test.security.*)
> > > > >
> > > > > Hermod
> > > > >
> > > > > -----Original Message-----
> > > > > From: aspectj-users-bounces@xxxxxxxxxxx
> > > > > [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Meir
> > > Yanovich
> > > > > Sent: Tuesday, November 27, 2007 1:25 PM
> > > > > To: aspectj-users@xxxxxxxxxxx
> > > > > Subject: [aspectj-users] How can I exclude class's in aspectJ
> > > > pointcuts
> > > > >
> > > > >
> > > > > Hello all
> > > > > I like to advice all the class's under :
> > > > > com.foo.test.* but NOT the classes under
com.fo.test.security.*
> > How
> > > > can
> > > > > I represent that with aspectJ pointcuts ?
> > > > > _______________________________________________
> > > > > aspectj-users mailing list
> > > > > aspectj-users@xxxxxxxxxxx
> > > > > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> > > > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
> *
> > *
> > > *
> > > > *
> > > > > * *
> > > > >
> > > > > This email with attachments is solely for the use of the
> > individual
> > > or
> > > > > entity to whom it is addressed. Please also be aware that the
> DnB
> > > NOR
> > > > > Group
> > > > > cannot accept any payment orders or other legally binding
> > > > correspondence
> > > > > with
> > > > > customers as a part of an email.
> > > > >
> > > > > This email message has been virus checked by the anti virus
> > programs
> > > > > used
> > > > > in the DnB NOR Group.
> > > > >
> > > > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
> *
> > *
> > > *
> > > > *
> > > > > * *
> > > > > _______________________________________________
> > > > > 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
> > > > >
> > > > _______________________________________________
> > > > 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
> > > >
> > > _______________________________________________
> > > 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
> > >
> > _______________________________________________
> > 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
> >
> _______________________________________________
> 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
>
_______________________________________________
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