[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] Pointcut - NoAspectBoundException
|
Normally the aspect state (for singleton aspects) is initialized very early - by code inserted into the static initializer for the aspect. I probably need to see a more complete failing example to comment on what is happening to you. If I try to replicate what you describe, I don't see the NoAspectBound, so I must be doing something a little different to you. Normally a NoAspectBound could indicate your aspect is advising itself and attempting to run advice before the static initializer has done its job. If you can post a failing sample I'll explain why it is doing what it is doing.
On your second point:
> For example the following point cut:
>
> @Pointcut("call(* com.blah.profiler.aspects.HelloWorld(..))")
> public void callPointCut() {
> }
>
> Is called for non-static methods i've defined in HelloWorld. How do I include static methods in the Pointcut definition?
As you haven't specified static or !static, that pointcut should be matching calls to static or non-static methods. If you wanted to limit it to static:
call(static * com.blah.profiler.aspects.HelloWorld(..))
If you wanted just non static
call(!static * com.blah.profiler.aspects.HelloWorld(..))
Hope that helps,
cheers,
Andy