Bug 113587 - LTW and AspectOf() NoSuchMethodError
Summary: LTW and AspectOf() NoSuchMethodError
Status: REOPENED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0M4   Edit
Hardware: All All
: P5 normal (vote)
Target Milestone: 1.5.0RC1   Edit
Assignee: Alexandre Vasseur CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-24 15:59 EDT by Yoav Landman CLA
Modified: 2009-08-30 02:48 EDT (History)
1 user (show)

See Also:


Attachments
Test case (1.76 MB, application/zip)
2005-10-24 16:17 EDT, Yoav Landman CLA
no flags Details
test case that throw exception (1.75 MB, application/octet-stream)
2007-03-22 19:59 EDT, Benjamin POUSSIN CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.