Bug 113587

Summary: LTW and AspectOf() NoSuchMethodError
Product: [Tools] AspectJ Reporter: Yoav Landman <yoavl>
Component: CompilerAssignee: Alexandre Vasseur <avasseur>
Status: REOPENED --- QA Contact:
Severity: normal    
Priority: P5 CC: poussin
Version: 1.5.0M4   
Target Milestone: 1.5.0RC1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Test case
none
test case that throw exception none

Description Yoav Landman CLA 2005-10-24 15:59:45 EDT
LTW fails when weaving an external jar with the above error.

Attached is a test case containing all required dependencies.
Unfortunately I cannot clean up any 3rd party libs, since the bug is only
reproducible using the jars in question (LTW on my own classes works just fine).

Simply run ant on the supplied build file (using JDK 1.5) to see the exception.
Comment 1 Yoav Landman CLA 2005-10-24 16:17:06 EDT
Created attachment 28709 [details]
Test case

NOTE:
Due to attachment size limit you need to add the following to the lib dir:
log4j-1.2.8.jar
xerces-2.6.2.jar
concurrent-1.3.4.jar
aspectjrt.jar
Comment 2 Yoav Landman CLA 2005-10-24 16:18:05 EDT
Due to attachment size limit you need to add the following to the lib dir:
log4j-1.2.8.jar
xerces-2.6.2.jar
concurrent-1.3.4.jar
aspectjrt.jar
Comment 3 Alexandre Vasseur CLA 2005-10-25 09:13:07 EDT
may be due to include use (aspect does not go in weaver type munging)
Comment 4 Alexandre Vasseur CLA 2005-10-25 09:56:20 EDT
yes it is
problem: if goes within weaver, then may apply other aspects to the aspect
itself, and we don't want that.

Perhaps need to detect that (mustNotWeaveButIsAspect) and then force the munging
thru a new BcelPerClauseAspectAdder
Comment 5 Alexandre Vasseur CLA 2005-10-25 11:34:44 EDT
done
IClassFileProvider.isApplyAtAspectJMungersOnly()
and some custom logic in BcelWeaver

try to get a next published build and give it a try
as a workaround, don't use an <include directive that contains your aspect, or
compile the aspect with AJC and not javaC.

Comment 6 Benjamin POUSSIN CLA 2007-03-22 19:59:51 EDT
Created attachment 61771 [details]
test case that throw exception

just execute run.sh or run.bat
Comment 7 Benjamin POUSSIN CLA 2007-03-22 20:03:50 EDT
With annotation i have same error with 1.5.3 version, NoSuchMethodError aspectOf(). I have join script to compile and run in test case. 

the result is:

Exception in thread "main" java.lang.reflect.InvocationTargetException
        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:597)
        at Test.main(Test.java:40)
Caused by: java.lang.NoSuchMethodError: Test$MyTestAspect.aspectOf()LTest$MyTestAspect;
        at toto.Toto.getToto(Toto.java:5)
        ... 5 more
Comment 8 Eclipse Webmaster CLA 2009-08-30 02:48:00 EDT
LATER/REMIND bugs are being automatically reopened as P5 because the LATER and REMIND resolutions are deprecated.