Community
Participate
Working Groups
This error raises: java.lang.NoSuchMethodError: com.example.aspects.MyAspect.aspectOf()Lcom/example/aspects/MyAspect; The weaver does not complain about this aspect not being valid. When registering this aspect using the aop.xml, this errror will not occur.
Just found out that doing the following will resolve this issue: if (exportedAspects.size() > 0 || exportedConcreteAspects.size() > 0 || (allAspectsDefinition != null && allAspectsDefinition .getWeaverOptions().length() > 0)) { final Definition exportedAspectsDefinition = new Definition(); exportedAspectsDefinition.getAspectClassNames().addAll( exportedAspects); exportedAspectsDefinition.getConcreteAspects().addAll( exportedConcreteAspects); if (allAspectsDefinition != null && allAspectsDefinition.getWeaverOptions().trim() .length() > 0) { exportedAspectsDefinition .appendWeaverOptions(allAspectsDefinition .getWeaverOptions()); } this.aspectDefinitionsExported.put(bundle, exportedAspectsDefinition); // add exportedAspectsDefinition to aspectDefinitions as well (bug?) this.aspectDefinitions.put(bundle, exportedAspectsDefinition); } I am not sure, but maybe the weaving service is mixing up aspectDefinitions and exportedAspectsDefinition...
This is an issue when the aspect is not compiled with AJDT (or another aspect compiler). This is typically the case if you use @Aspect-style aspect programming and not compiling using AJDT. I am not sure how this is related to the solution you mention, but I will try to find out... :-)
Yes, I am using annotation style aspects. But it is strange that adding exportedAspectsDefinition to aspectDefinitions resolves this.
I also experience this bug whenever I compile @aspect annotated aspects with javac instead of ajc. This only happens with AspectJ 1.6.7 or newer!
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
The aspect weaving component has moved. I'm not sure if this bug is relevant anymore but moving to aspectj to close.