Skip to main content

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

Thanks, Andy,
 
I'll put something together.  This is important to me going forward to understand how to handle issues like this when weaving fails.  I've been giving the hard-sell to my company but I have to be able to diagnose these kinds of problems.
 
I'll get back to you, and thanks for your willingness to make this work.
 
Scott


From: Andy Clement <andrew.clement@xxxxxxxxx>
To: AspectJ developer discussions <aspectj-dev@xxxxxxxxxxx>
Sent: Thu, June 23, 2011 12:05:38 PM
Subject: Re: [aspectj-dev] [Xlint:adviceDidNotMatch]

Hi,

> So what you are doing in your example, weaving SomeAspect.aj into a jar is
> similar to what I'm doing, just that I'm doing it with the class files and
> not a jar.

So you are using inpath, I just want to make sure you aren't just
using classpath.

> This was working before, but it's possible being a big project with multiple
> developers that some other jar file in my classpath is messing with
> aspectj.

I can't think what could be messing with it because AspectJ has no
external dependencies, everything is in aspectjtools.jar

> I could probably provide you with a war file
> that contains some source.  That's a little touchy since the code is
> proprietary. I think though that I could probably recreate this without
> sending everything along with it.

If you can recreate the issue without proprietary code, that would be
a good way for me to determine whats wrong.  Email it to me or raise a
bugzilla https://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ
and we can investigate, hopefully it'll be something straightforward.

Andy

> ________________________________
> From: Andy Clement <andrew.clement@xxxxxxxxx>
> To: AspectJ developer discussions <aspectj-dev@xxxxxxxxxxx>
> Sent: Wed, June 22, 2011 6:12:24 PM
> Subject: 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
>>
>>
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>
>
_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-dev

Back to the top