Bug 125916 - AspectJ compiler error when weaving spring.jar version 1.2.4
Summary: AspectJ compiler error when weaving spring.jar version 1.2.4
Status: RESOLVED WORKSFORME
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.6.2   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-31 15:27 EST by Jim Fontana CLA
Modified: 2008-10-02 13:47 EDT (History)
2 users (show)

See Also:


Attachments
ajcore file (31.85 KB, text/plain)
2006-01-31 15:27 EST, Jim Fontana CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Fontana CLA 2006-01-31 15:27:01 EST
AspectJ gets a fatal error when weaving spring.jar version 1.2.4 (ajcore file attached).  Am able to weave same aspects using AspectJ 1.2.1 and am able to weave using same aspects and an earlier version of spring.jar (1.1.3dev).
Comment 1 Jim Fontana CLA 2006-01-31 15:27:45 EST
Created attachment 33884 [details]
ajcore file
Comment 2 Jim Fontana CLA 2006-01-31 18:57:03 EST
The JVM it fails with is 1.4.2.  It does work, however, with JVM 1.5.0.
Comment 3 Andrew Clement CLA 2006-02-01 03:44:11 EST
There are multiple exceptions in the trace.

The first exception is:

java.lang.IllegalStateException: Expecting raw type org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:42)
org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:82)

which I *think* I fixed recently for another bug.  The other exceptions are:

java.lang.RuntimeException: Can't find type java.lang.annotation.Annotation
org.aspectj.weaver.World.handleRequiredMissingTypeDuringResolution(World.java:241)
org.aspectj.weaver.World.resolve(World.java:219)

java.lang.RuntimeException: Can't find type org.hibernate.usertype.UserType
org.aspectj.weaver.World.handleRequiredMissingTypeDuringResolution(World.java:241)
org.aspectj.weaver.World.resolve(World.java:219)

java.lang.RuntimeException: Can't find type net.sf.cglib.proxy.MethodInterceptor
org.aspectj.weaver.World.handleRequiredMissingTypeDuringResolution(World.java:241)
org.aspectj.weaver.World.resolve(World.java:219)

java.lang.RuntimeException: Can't find type java.lang.Enum
org.aspectj.weaver.World.handleRequiredMissingTypeDuringResolution(World.java:241)
org.aspectj.weaver.World.resolve(World.java:219)


It looks like some elements of spring 1.2.4 contain Java5 code - perhaps they aren't utilised if spring is executed on a 1.4 VM but they are still in the jar.  So if we try and weave the entire jar on a 1.4 vm we still attempt to resolve the dependencies for these 1.5 related entities.

I'll probably have to leave Adrian to explore it further...
Comment 4 Andrew Clement CLA 2006-07-11 04:02:36 EDT
During 1.5.1a/1.5.2 development I fixed numerous cases of "Expecting raw type" - have you tried weaving spring with a more recent AspectJ?  The 'cantFindType' xlint option can currently be set to 'ignore' for skipping errors about missing types if you *know* that the code for which the types cannot be found will not be executed.  cantfindtype may get deprecated shortly though, replaced with a more robust mechanism.
Comment 5 Tom Duffey CLA 2007-05-05 11:10:36 EDT
I currently get errors weaving spring.jar w/Spring 2.0.4, JDK 1.5 and both AspectJ 1.5.3a and the latest dev build:

[iajc]  -- (ClassCastException) org.aspectj.weaver.MissingResolvedTypeWithKnownSignature
     [iajc] org.aspectj.weaver.MissingResolvedTypeWithKnownSignature
     [iajc] java.lang.ClassCastException: org.aspectj.weaver.MissingResolvedTypeWithKnownSignature
     [iajc] 	at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.typeArgument2TypeX(BcelGenericSignatureToTypeXConverter.java:187)
     [iajc] 	at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:94)
     [iajc] 	at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.fieldTypeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:131)
     [iajc] 	at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.typeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:217)
     [iajc] 	at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.typeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:202)
     [iajc] 	at org.aspectj.weaver.bcel.BcelMethod.unpackGenericSignature(BcelMethod.java:365)
     [iajc] 	at org.aspectj.weaver.bcel.BcelMethod.getGenericParameterTypes(BcelMethod.java:312)
etc.

Let me know if there is anything I can provide to help but I think you can reproduce it simply by trying to weave the latest spring.jar.
Comment 6 Andrew Clement CLA 2007-10-23 12:10:16 EDT
diagnose in 1.5.4 timeframe
Comment 7 Andrew Clement CLA 2008-09-30 13:13:33 EDT
is this still happening... ?
Comment 8 Andrew Clement CLA 2008-10-02 13:47:18 EDT
still unable to recreate this.  Will probably need details of the aspect being used to proceed.  please reopen if still a problem for you, I know 1.2.4 is a while ago...