Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] [Xlint:adviceDidNotMatch]

Hi Scott,

Are you binary weaving or building all from source?  It sounds like
you are binary weaving.

Maybe I'm reading too much into it, but you mention that myClass is on
your *classpath* - that isn't sufficient for it to be woven when
compiling your aspect.  classpath is only used to resolve
dependencies.

If you want to weave some bunch of code you built earlier, you should
use inpath:

ajc -inpath myPreviouslyBuiltCode.jar SomeAspect.aj -outjar
wovenVersionOfThatCode.jar

But if it is that, it doesn't explain why you get different behaviour
dependent on version... If there is a regression here I'd like to get
it resolved, rather than force you back to an old level.  The only
known regression I'm aware of at the moment relates to a particular
kind of annotation matching, and you don't appear to be using
annotations in your pointcut.

cheers
Andy

On 22 June 2011 14:35, Scott <jackett_dad@xxxxxxxxx> wrote:
> I'm working on an aspect that used to work, but I've since changed versions
> of java from 1.5 to 1.6.
>
> Java version is 1.6.0_25, and for AspectJ is the latest as of today(
> 1.6.12.M1 ).  I had successfully used AspectJ version 1.6.11.  When I was
> trying to get this all working in the first place, I was using 1.6.10, and
> was having the same issue as I'm seeing now.
>
> I'm getting the warning in the subject line that my advice does not match.
> I can't get any advice working that refers to my code. If I do this:
>
> public aspect proAuditAspect
> {
>     pointcut traced() : ! within( proAuditAspect );
>
>     before() : traced()
>     {
>     }
> }
>
> ...I get no warning. But if I do this:
>
> import com.myCompany.myClass;
>
> public aspect proAuditAspect
> {
>     pointcut traced() : execution( * myClass.execute() ) &&
>         ! within( proAuditAspect );
>     before() : traced()
>     {
>     }
> }
>
> (the difference is only the bolded part)
>
> The class exists in my classpath, but I get the warning and the advice is
> never called.
>
> I'm not sure what anyone on the list can do without my environment, but is
> there anything I'm missing?  Should I try going back a few versions of
> AspectJ?  I've tried dropping back to Java 1.5, but same problem.
>
> I use the ajc compiler to compile my java classes. and set the target to
> 1.5.
>
> Thanks for any advice (no pun intended) you can give.
>
> Scott
>
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>
>


Back to the top