Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » My Aspect is not run
My Aspect is not run [message #65104] Tue, 23 May 2006 12:55 Go to next message
Jimisola Laursen is currently offline Jimisola LaursenFriend
Messages: 134
Registered: July 2009
Senior Member
Hi!

I believe that I have my pointcut and my only advice (TransactionAspect)
setup correct - no errors or warnings.
AJDT says "38 AspectJ markers at this line" on the line of my "around"
advice.

One method that this around advice should be applied to is Server.start.
If I look on the method signature line AJDT says "advised by
TransactionAspect.around(Transcational): TRANSACTIONAL.. (runtime test)".

I've added several break points, both in the actual code of the around
advice and in code in other classes that it calls, but none of the break
points are hit (yes, I am running the application in debug mode). I also do
debug outputs in the around advice both to stderr and to a logfile (using
log4j) - no output what so ever.

The odd thing is that when I hit a breakpoint in the method that the advice
is suppose to be applied on - Server.start - then I see the following in the
Debug Window:

Thread[main] (Suspended (breakpoint at line 285 in Server)
Server.start_aroundBody0(Server, Properties, JoinPoint) line: 285
Server.start(Properties) line: 1

Any idea on what my problem is. If you need the actual aspect to help me I
gladly provide it.

Regards,
Jimisola
Re: My Aspect is not run [message #65255 is a reply to message #65104] Wed, 24 May 2006 08:36 Go to previous messageGo to next message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Hi,

I think the "(runtime test)" bit is the key here. This is indicating
that the advice will only apply if a particular test passes at runtime.
This occurs when the pointcut used contains a designator like cflow
where the matches cannot be fully determined at compile time. In
addition to the "(runtime test)" text, the advice marker uses an icon
with a small question mark to indicate this - and shows all the
*potential* matches.

The advice is showing in the stack trace because the runtime test has
been woven into the class, but the test is not passing at runtime so the
advice is not reached.

Regards,

Matt.

Jimisola Laursen wrote:
> Hi!
>
> I believe that I have my pointcut and my only advice (TransactionAspect)
> setup correct - no errors or warnings.
> AJDT says "38 AspectJ markers at this line" on the line of my "around"
> advice.
>
> One method that this around advice should be applied to is Server.start.
> If I look on the method signature line AJDT says "advised by
> TransactionAspect.around(Transcational): TRANSACTIONAL.. (runtime test)".
>
> I've added several break points, both in the actual code of the around
> advice and in code in other classes that it calls, but none of the break
> points are hit (yes, I am running the application in debug mode). I also do
> debug outputs in the around advice both to stderr and to a logfile (using
> log4j) - no output what so ever.
>
> The odd thing is that when I hit a breakpoint in the method that the advice
> is suppose to be applied on - Server.start - then I see the following in the
> Debug Window:
>
> Thread[main] (Suspended (breakpoint at line 285 in Server)
> Server.start_aroundBody0(Server, Properties, JoinPoint) line: 285
> Server.start(Properties) line: 1
>
> Any idea on what my problem is. If you need the actual aspect to help me I
> gladly provide it.
>
> Regards,
> Jimisola
>
>
Re: My Aspect is not run [message #65297 is a reply to message #65255] Wed, 24 May 2006 12:53 Go to previous messageGo to next message
Jimisola Laursen is currently offline Jimisola LaursenFriend
Messages: 134
Registered: July 2009
Senior Member
"Matt Chapman" <mpchapman@gmail.com> wrote in message
news:e515tv$ke7$1@utils.eclipse.org...
> Hi,
>
> I think the "(runtime test)" bit is the key here. This is indicating that
> the advice will only apply if a particular test passes at runtime. This
> occurs when the pointcut used contains a designator like cflow where the
> matches cannot be fully determined at compile time. In addition to the
> "(runtime test)" text, the advice marker uses an icon with a small
> question mark to indicate this - and shows all the *potential* matches.
>
> The advice is showing in the stack trace because the runtime test has been
> woven into the class, but the test is not passing at runtime so the advice
> is not reached.

Ok. Thank you for your explaination.

During the writings of this mail I managed to get my aspect/advice /point
cut working
I mistakingly used @this instead of @annotation. However, there are some
questions that arose...

The advice marker in fact has the question mark icon (it is barely visible -
even when you know about).
Is there any way that I can add a breakpoint at the point cut match
evalution? It would really help trouble shooting point cuts (in the future).

When on the breakpoint questions.. I've added a couple of break points in my
advice, but they are never hit.
Execution stops nicely on breakpoints outside of the advice - do I need to
activate something in the configuration for AspectJ/AJDT?

Regards,
Jimisola
Re: My Aspect is not run [message #65339 is a reply to message #65297] Thu, 25 May 2006 11:01 Go to previous messageGo to next message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Jimisola Laursen wrote:
> The advice marker in fact has the question mark icon (it is barely visible -
> even when you know about).
> Is there any way that I can add a breakpoint at the point cut match
> evalution? It would really help trouble shooting point cuts (in the future).

No, unfortunately you can't do that. It's a known issue that better
support is needed to help understand dynamic behaviour like this - it
has been the subject of some academic projects, and it's definitely
something we want to focus on in the future - I don't think that's a
quick fix for this.

> When on the breakpoint questions.. I've added a couple of break points in my
> advice, but they are never hit.
> Execution stops nicely on breakpoints outside of the advice - do I need to
> activate something in the configuration for AspectJ/AJDT?

There is a quick fix for this: AspectJ Compiler > Advanced > No Inline
(should only be needed for around advice)

Regards,

Matt.
Re: My Aspect is not run [message #65360 is a reply to message #65339] Fri, 26 May 2006 07:23 Go to previous message
Jimisola Laursen is currently offline Jimisola LaursenFriend
Messages: 134
Registered: July 2009
Senior Member
"Matt Chapman" <mpchapman@gmail.com> wrote in message
news:e542qo$68m$1@utils.eclipse.org...
> Jimisola Laursen wrote:
>> The advice marker in fact has the question mark icon (it is barely
>> visible - even when you know about).
>> Is there any way that I can add a breakpoint at the point cut match
>> evalution? It would really help trouble shooting point cuts (in the
>> future).
>
> No, unfortunately you can't do that. It's a known issue that better
> support is needed to help understand dynamic behaviour like this - it has
> been the subject of some academic projects, and it's definitely something
> we want to focus on in the future - I don't think that's a quick fix for
> this.

Ok. Well, I hope that there will be an improvement on this known issue soon
then.
It will easyedebugging a lot and, like you said, help understanding dynamic
behaviour (especially for newbies).

>> When on the breakpoint questions.. I've added a couple of break points in
>> my advice, but they are never hit.
>> Execution stops nicely on breakpoints outside of the advice - do I need
>> to activate something in the configuration for AspectJ/AJDT?
>
> There is a quick fix for this: AspectJ Compiler > Advanced > No Inline
> (should only be needed for around advice)

I had this marked already, but it did not work. Unmarked, remarked and
cleaned project - now it works as expected.

/J
Re: My Aspect is not run [message #593854 is a reply to message #65104] Wed, 24 May 2006 08:36 Go to previous message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Hi,

I think the "(runtime test)" bit is the key here. This is indicating
that the advice will only apply if a particular test passes at runtime.
This occurs when the pointcut used contains a designator like cflow
where the matches cannot be fully determined at compile time. In
addition to the "(runtime test)" text, the advice marker uses an icon
with a small question mark to indicate this - and shows all the
*potential* matches.

The advice is showing in the stack trace because the runtime test has
been woven into the class, but the test is not passing at runtime so the
advice is not reached.

Regards,

Matt.

Jimisola Laursen wrote:
> Hi!
>
> I believe that I have my pointcut and my only advice (TransactionAspect)
> setup correct - no errors or warnings.
> AJDT says "38 AspectJ markers at this line" on the line of my "around"
> advice.
>
> One method that this around advice should be applied to is Server.start.
> If I look on the method signature line AJDT says "advised by
> TransactionAspect.around(Transcational): TRANSACTIONAL.. (runtime test)".
>
> I've added several break points, both in the actual code of the around
> advice and in code in other classes that it calls, but none of the break
> points are hit (yes, I am running the application in debug mode). I also do
> debug outputs in the around advice both to stderr and to a logfile (using
> log4j) - no output what so ever.
>
> The odd thing is that when I hit a breakpoint in the method that the advice
> is suppose to be applied on - Server.start - then I see the following in the
> Debug Window:
>
> Thread[main] (Suspended (breakpoint at line 285 in Server)
> Server.start_aroundBody0(Server, Properties, JoinPoint) line: 285
> Server.start(Properties) line: 1
>
> Any idea on what my problem is. If you need the actual aspect to help me I
> gladly provide it.
>
> Regards,
> Jimisola
>
>
Re: My Aspect is not run [message #593869 is a reply to message #65255] Wed, 24 May 2006 12:53 Go to previous message
Jimisola Laursen is currently offline Jimisola LaursenFriend
Messages: 134
Registered: July 2009
Senior Member
"Matt Chapman" <mpchapman@gmail.com> wrote in message
news:e515tv$ke7$1@utils.eclipse.org...
> Hi,
>
> I think the "(runtime test)" bit is the key here. This is indicating that
> the advice will only apply if a particular test passes at runtime. This
> occurs when the pointcut used contains a designator like cflow where the
> matches cannot be fully determined at compile time. In addition to the
> "(runtime test)" text, the advice marker uses an icon with a small
> question mark to indicate this - and shows all the *potential* matches.
>
> The advice is showing in the stack trace because the runtime test has been
> woven into the class, but the test is not passing at runtime so the advice
> is not reached.

Ok. Thank you for your explaination.

During the writings of this mail I managed to get my aspect/advice /point
cut working
I mistakingly used @this instead of @annotation. However, there are some
questions that arose...

The advice marker in fact has the question mark icon (it is barely visible -
even when you know about).
Is there any way that I can add a breakpoint at the point cut match
evalution? It would really help trouble shooting point cuts (in the future).

When on the breakpoint questions.. I've added a couple of break points in my
advice, but they are never hit.
Execution stops nicely on breakpoints outside of the advice - do I need to
activate something in the configuration for AspectJ/AJDT?

Regards,
Jimisola
Re: My Aspect is not run [message #593899 is a reply to message #65297] Thu, 25 May 2006 11:01 Go to previous message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Jimisola Laursen wrote:
> The advice marker in fact has the question mark icon (it is barely visible -
> even when you know about).
> Is there any way that I can add a breakpoint at the point cut match
> evalution? It would really help trouble shooting point cuts (in the future).

No, unfortunately you can't do that. It's a known issue that better
support is needed to help understand dynamic behaviour like this - it
has been the subject of some academic projects, and it's definitely
something we want to focus on in the future - I don't think that's a
quick fix for this.

> When on the breakpoint questions.. I've added a couple of break points in my
> advice, but they are never hit.
> Execution stops nicely on breakpoints outside of the advice - do I need to
> activate something in the configuration for AspectJ/AJDT?

There is a quick fix for this: AspectJ Compiler > Advanced > No Inline
(should only be needed for around advice)

Regards,

Matt.
Re: My Aspect is not run [message #593908 is a reply to message #65339] Fri, 26 May 2006 07:23 Go to previous message
Jimisola Laursen is currently offline Jimisola LaursenFriend
Messages: 134
Registered: July 2009
Senior Member
"Matt Chapman" <mpchapman@gmail.com> wrote in message
news:e542qo$68m$1@utils.eclipse.org...
> Jimisola Laursen wrote:
>> The advice marker in fact has the question mark icon (it is barely
>> visible - even when you know about).
>> Is there any way that I can add a breakpoint at the point cut match
>> evalution? It would really help trouble shooting point cuts (in the
>> future).
>
> No, unfortunately you can't do that. It's a known issue that better
> support is needed to help understand dynamic behaviour like this - it has
> been the subject of some academic projects, and it's definitely something
> we want to focus on in the future - I don't think that's a quick fix for
> this.

Ok. Well, I hope that there will be an improvement on this known issue soon
then.
It will easyedebugging a lot and, like you said, help understanding dynamic
behaviour (especially for newbies).

>> When on the breakpoint questions.. I've added a couple of break points in
>> my advice, but they are never hit.
>> Execution stops nicely on breakpoints outside of the advice - do I need
>> to activate something in the configuration for AspectJ/AJDT?
>
> There is a quick fix for this: AspectJ Compiler > Advanced > No Inline
> (should only be needed for around advice)

I had this marked already, but it did not work. Unmarked, remarked and
cleaned project - now it works as expected.

/J
Previous Topic:percflow() error
Next Topic:AJDT New Feature: New Plug-in Example
Goto Forum:
  


Current Time: Fri Mar 29 06:46:26 GMT 2024

Powered by FUDForum. Page generated in 0.03965 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top