Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] NoSuchMethod aspectOf exception using LTW.

Hi Andy,

Thanks for the reply. I too was thinking of using static weaving for the aspects during build. I would do that using AJC during maven build process. 

However what I am not sure of is the weaving during the development time. 

Would I be able to get static weaving done when I am in the development process of the aspects bundle? Would eclipse do the weaving when it builds the project during development?

Thanks for your help,
Shashi
-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andy Clement
Sent: Thursday, September 24, 2009 1:06 AM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] NoSuchMethod aspectOf exception using LTW.

So when the weaver management and delegation logic is in the same
bundle as the unfinished aspect, they don't see the aspect that needs
finishing off.  I would expect (in an equinox aspects case) that the
classloader for the bundle that contains/defines the unfinished aspect
should have a weaver attached responsible for finishing off the aspect
class (and this wouldn't be one you are managing, it would be one
controlled by equinox aspects)  Can you just use compile time weaving
to finish that aspect off when you first build it, then you wouldn't
need to rely on it being finished at load time during each startup.

Andy

2009/9/23 Shashikant Kale <Shashikant.Kale@xxxxxxxxxxxxxxxx>:
> Hi Andy,
>
> If I move the weavers to a different bundle than the bundle containing the aspects then everything works fine as the aspect classes are 'finished off' by the weaver.
>
> However would there be a way to contain the weaver and the aspect code in the same bundle?
>
> Regards,
> Shashi
>
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Shashikant Kale
> Sent: Wednesday, September 23, 2009 10:00 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: RE: [aspectj-users] NoSuchMethod aspectOf exception using LTW.
>
> Hi Andy,
>
> Thanks for the reply.
>
> I can relate your reply to the current aspects setup in my project.
>
> Let me explain what exactly I am trying to do.
>
> I have multiple weavers in the project viz, 1) the equinox.aspects weaver to weave regular aspects and 2) spring weaver to weave the JPA entities at load time. Currently equinox aspects project doesn't support multiple weavers hence I had to write my own weaving bundle which delegates weaving task to multiple weavers. The weavers are registered in my delegating bundle as soon as they are up.
>
> I had the delegating weaving code in a separate bundle than the bundle which contains the aspects. This setup was working all fine until I moved the weaving code inside the bundle containing aspects.
>
> I think your reply gives hint that the aspects bundle is not getting weaved by the weaver present in the same bundle.
>
> Do you also think alike?
>
> Please let me know.
>
> Regards,
> Shashi
>
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andy Clement
> Sent: Wednesday, September 23, 2009 9:52 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: Re: [aspectj-users] NoSuchMethod aspectOf exception using LTW.
>
> Even if your aspect is defined with annotation style, and built with
> javac, it must go through the weaver to be 'finished off' and become
> usable as a real aspect.  This pass through the weaver will create the
> aspectOf() method that the woven code is trying to call.  Is your
> aspect being allowed to be finished off by a weaver instance?
>
> Andy
>
> 2009/9/23 Shashikant Kale <Shashikant.Kale@xxxxxxxxxxxxxxxx>:
>> Hi,
>>
>>
>>
>> I am using LTW in OSGi (equinox) environment. I am using
>> eclipse.equinox.aspectj project to do this.
>>
>>
>>
>> However I am getting an exception
>>
>>
>>
>> Caused by: java.lang.NoSuchMethodError:
>> com.arisglobal.aglite.aop.EntityAuditAspect.aspectOf()Lcom/arisglobal/aglite/aop/EntityAuditAspect;
>>
>>             at com.arisglobal.aglitepq.entity.Emp.getDept(Emp.java:113)
>>
>>             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>>             at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>
>>             at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>
>>             at java.lang.reflect.Method.invoke(Method.java:585)
>>
>>             at
>> org.directwebremoting.extend.PropertyDescriptorProperty.getValue(PropertyDescriptorProperty.java:72)
>>
>>
>>
>> I have defined the EntityAuditAspect using @Aspect annotation and have
>> defined the aspect in the aop.xml.
>>
>>
>>
>> I have checked that the target class is getting weaved fine and see that the
>> call to aspectOf method of EntityAudit aspect is getting generated in the
>> resulting byte code. However this method doesn't exist in my aspect class.
>>
>>
>>
>> I am sure this exception has been resolved long back. However I am not able
>> to figure out why would this occur in my case?
>>
>>
>>
>> Could somebody please throw some light on this?
>>
>>
>>
>> Thanks,
>>
>> Shashi
>>
>>
>>
>> _______________________________________________
>> 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