Bug 122580 - Fix & Bug: Circularity Failure for Verbose Loading on JRockit 1.4.2_08 Agent
Summary: Fix & Bug: Circularity Failure for Verbose Loading on JRockit 1.4.2_08 Agent
Status: RESOLVED FIXED
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: ---   Edit
Assignee: Matthew Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-03 20:19 EST by Ron Bodkin CLA
Modified: 2012-04-03 15:40 EDT (History)
1 user (show)

See Also:


Attachments
Patch to loadtime module to fix problems weaving on older JRockIt VM (2.50 KB, patch)
2006-01-04 02:53 EST, Ron Bodkin CLA
aclement: iplog+
Details | Diff
Patch to weaver module to fix problems weaving on older JRockIt VM (1.29 KB, patch)
2006-01-04 02:59 EST, Ron Bodkin CLA
aclement: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2006-01-03 20:19:46 EST
Here is a stack trace I am getting when I try to use AspectJ 1.5.0 final release's load-time weaving with JRockIt 1.4.2_08 using -Xmanagement:class=org.aspectj.weaver.loadtime.JRockitAgent to load Weblogic Server 8.1 SP2. I debugged the code in Eclipse and discovered that the weaver was being initialized while loading IMessage$Kind, so the JRockIt VM simply hasn't run staticinitialization yet, making IMessage.INFO null.

I was able to fix this stack trace by hoisting the check for loading AspectJ code up BEFORE initializing a weaving adaptor i.e., changing line 55 of Aj.java to be
        if (loader == null || className == null || className.startsWith("org/aspectj/")) {

I then commented out line 251 of WeavingAdaptor to avoid a duplicate check:
	private boolean shouldWeaveName (String name) {
		return !((/*(name.startsWith("org.apache.bcel.")||//FIXME AV why ? bcel is wrapped in org.aspectj.
                name.startsWith("org.aspectj.")||*/ // now checked earlier, to avoid circularity issues in initialization 
                name.startsWith("java.")
                || name.startsWith("javax."))
                //|| name.startsWith("$Proxy")//JDK proxies//FIXME AV is that 1.3 proxy ? fe. ataspect.$Proxy0 is a java5 proxy...
                || name.startsWith("sun.reflect."));//JDK reflect
	}

Note that this bug does NOT occur when using a JRockIt 1.5.0 VM, even with the -Xmanagement command line argument.

Stack Trace:
java.lang.IllegalArgumentException: null kind
	at org.aspectj.bridge.Message.<init>(Ljava/lang/String;Ljava/lang/String;Lorg/aspectj/bridge/IMessage$Kind;Lorg/aspectj/bridge/ISourceLocation;Ljava/lang/Throwable;[Lorg/aspectj/bridge/ISourceLocation;ZIII)V(Message.java:89)
	at org.aspectj.bridge.Message.<init>(Ljava/lang/String;Ljava/lang/String;Lorg/aspectj/bridge/IMessage$Kind;Lorg/aspectj/bridge/ISourceLocation;Ljava/lang/Throwable;[Lorg/aspectj/bridge/ISourceLocation;)V(Message.java:67)
	at org.aspectj.bridge.Message.<init>(Ljava/lang/String;Lorg/aspectj/bridge/IMessage$Kind;Ljava/lang/Throwable;Lorg/aspectj/bridge/ISourceLocation;)V(Message.java:110)
	at org.aspectj.bridge.MessageUtil.info(Ljava/lang/String;)Lorg/aspectj/bridge/IMessage;(MessageUtil.java:211)
	at org.aspectj.bridge.MessageUtil.info(Lorg/aspectj/bridge/IMessageHandler;Ljava/lang/String;)Z(MessageUtil.java:98)
	at org.aspectj.weaver.tools.WeavingAdaptor.info(Ljava/lang/String;)Z(WeavingAdaptor.java:343)
	at org.aspectj.weaver.tools.WeavingAdaptor.createMessageHandler()V(WeavingAdaptor.java:168)
	at org.aspectj.weaver.tools.WeavingAdaptor.<init>()V(WeavingAdaptor.java:80)
	at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.<init>(Ljava/lang/ClassLoader;Lorg/aspectj/weaver/loadtime/IWeavingContext;)V(ClassLoaderWeavingAdaptor.java:70)
	at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Ljava/lang/ClassLoader;Lorg/aspectj/weaver/loadtime/IWeavingContext;)Lorg/aspectj/weaver/tools/WeavingAdaptor;(Aj.java:94)
	at org.aspectj.weaver.loadtime.Aj.preProcess(Ljava/lang/String;[BLjava/lang/ClassLoader;)[B(Aj.java:61)
	at org.aspectj.weaver.loadtime.JRockitAgent.preProcess(Ljava/lang/ClassLoader;Ljava/lang/String;[B)[B(JRockitAgent.java:74)
	at jrockit.vm.ClassPreProcessorManager.notifyClassPreProcessor(ILjava/lang/String;[B)[B(Unknown Source)
	at jrockit.vm.Classes.defineClass0(ILjava/lang/String;[BII)I(Unknown Source)
	at jrockit.vm.Classes.defineClass(Ljava/lang/ClassLoader;Ljava/lang/String;[BII)Ljava/lang/Class;(Unknown Source)
	at java.lang.ClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class;(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/CodeSource;)Ljava/lang/Class;(SecureClassLoader.java:123)
	at java.net.URLClassLoader.defineClass(Ljava/lang/String;Lsun/misc/Resource;)Ljava/lang/Class;(URLClassLoader.java:251)
	at java.net.URLClassLoader.access$100(Ljava/net/URLClassLoader;Ljava/lang/String;Lsun/misc/Resource;)Ljava/lang/Class;(URLClassLoader.java:55)
	at java.net.URLClassLoader$1.run()Ljava/lang/Object;(URLClassLoader.java:194)
	at jrockit.vm.AccessController.do_privileged_exc(Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext;I)Ljava/lang/Object;(Unknown Source)
	at jrockit.vm.AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;(Unknown Source)
	at java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class;(URLClassLoader.java:187)
	at java.lang.ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class;(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class;(Launcher.java:274)
	at java.lang.ClassLoader.loadClass(Ljava/lang/String;)Ljava/lang/Class;(Unknown Source)
	at java.lang.ClassLoader.loadClassFromNative(II)Ljava/lang/Class;(Unknown Source)
	at jrockit.vm.RNI.getRunnableCode(I)I(Unknown Source)
	at jrockit.vm.RNI.trampoline()V(Unknown Source)
	at org.aspectj.bridge.MessageUtil.info(Ljava/lang/String;)Lorg/aspectj/bridge/IMessage;(MessageUtil.java:???)
	at org.aspectj.bridge.MessageUtil.info(Lorg/aspectj/bridge/IMessageHandler;Ljava/lang/String;)Z(MessageUtil.java:98)
	at org.aspectj.weaver.tools.WeavingAdaptor.info(Ljava/lang/String;)Z(WeavingAdaptor.java:343)
java.lang.IllegalArgumentException: null kind
	at org.aspectj.bridge.Message.<init>(Ljava/lang/String;Ljava/lang/String;Lorg/aspectj/bridge/IMessage$Kind;Lorg/aspectj/bridge/ISourceLocation;Ljava/lang/Throwable;[Lorg/aspectj/bridge/ISourceLocation;ZIII)V(Message.java:89)
	at org.aspectj.bridge.Message.<init>(Ljava/lang/String;Ljava/lang/String;Lorg/aspectj/bridge/IMessage$Kind;Lorg/aspectj/bridge/ISourceLocation;Ljava/lang/Throwable;[Lorg/aspectj/bridge/ISourceLocation;)V(Message.java:67)
	at org.aspectj.bridge.Message.<init>(Ljava/lang/String;Lorg/aspectj/bridge/IMessage$Kind;Ljava/lang/Throwable;Lorg/aspectj/bridge/ISourceLocation;)V(Message.java:110)
	at org.aspectj.bridge.MessageUtil.info(Ljava/lang/String;)Lorg/aspectj/bridge/IMessage;(MessageUtil.java:211)
	at org.aspectj.bridge.MessageUtil.info(Lorg/aspectj/bridge/IMessageHandler;Ljava/lang/String;)Z(MessageUtil.java:98)
	at org.aspectj.weaver.tools.WeavingAdaptor.info(Ljava/lang/String;)Z(WeavingAdaptor.java:343)
	at org.aspectj.weaver.tools.WeavingAdaptor.createMessageHandler()V(WeavingAdaptor.java:168)
	at org.aspectj.weaver.tools.WeavingAdaptor.<init>()V(WeavingAdaptor.java:80)
	at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.<init>(Ljava/lang/ClassLoader;Lorg/aspectj/weaver/loadtime/IWeavingContext;)V(ClassLoaderWeavingAdaptor.java:70)
	at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Ljava/lang/ClassLoader;Lorg/aspectj/weaver/loadtime/IWeavingContext;)Lorg/aspectj/weaver/tools/WeavingAdaptor;(Aj.java:94)
	at org.aspectj.weaver.loadtime.Aj.preProcess(Ljava/lang/String;[BLjava/lang/ClassLoader;)[B(Aj.java:61)
	at org.aspectj.weaver.loadtime.JRockitAgent.preProcess(Ljava/lang/ClassLoader;Ljava/lang/String;[B)[B(JRockitAgent.java:74)
	at jrockit.vm.ClassPreProcessorManager.notifyClassPreProcessor(ILjava/lang/String;[B)[B(Unknown Source)
	at jrockit.vm.Classes.defineClass0(ILjava/lang/String;[BII)I(Unknown Source)
	at jrockit.vm.Classes.defineClass(Ljava/lang/ClassLoader;Ljava/lang/String;[BII)Ljava/lang/Class;(Unknown Source)
	at java.lang.ClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class;(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/CodeSource;)Ljava/lang/Class;(SecureClassLoader.java:123)
	at java.net.URLClassLoader.defineClass(Ljava/lang/String;Lsun/misc/Resource;)Ljava/lang/Class;(URLClassLoader.java:251)
	at java.net.URLClassLoader.access$100(Ljava/net/URLClassLoader;Ljava/lang/String;Lsun/misc/Resource;)Ljava/lang/Class;(URLClassLoader.java:55)
	at java.net.URLClassLoader$1.run()Ljava/lang/Object;(URLClassLoader.java:194)
	at jrockit.vm.AccessController.do_privileged_exc(Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext;I)Ljava/lang/Object;(Unknown Source)
	at jrockit.vm.AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;(Unknown Source)
	at java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class;(URLClassLoader.java:187)
	at java.lang.ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class;(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class;(Launcher.java:274)
	at java.lang.ClassLoader.loadClass(Ljava/lang/String;)Ljava/lang/Class;(Unknown Source)
	at java.lang.ClassLoader.loadClassFromNative(II)Ljava/lang/Class;(Unknown Source)
	at jrockit.vm.RNI.getRunnableCode(I)I(Unknown Source)
	at jrockit.vm.RNI.trampoline()V(Unknown Source)
	at org.aspectj.bridge.MessageUtil.info(Lorg/aspectj/bridge/IMessageHandler;Ljava/lang/String;)Z(MessageUtil.java:???)
	at org.aspectj.weaver.tools.WeavingAdaptor.info(Ljava/lang/String;)Z(WeavingAdaptor.java:343)
	at org.aspectj.weaver.tools.WeavingAdaptor.createMessageHandler()V(WeavingAdaptor.java:168)
Comment 1 Ron Bodkin CLA 2006-01-03 21:48:34 EST
By the way, this error occurs with *no* aop.xml file even defined. Just enabling the AspectJ JRockIt agent and starting Weblogic causes it...
Comment 2 Ron Bodkin CLA 2006-01-04 02:48:41 EST
Ok this appears to be symptomatic of a deeper problem. The older BEA VM's are choking because the classloader agent is part of the classpath and we are weaving everything on the system classpath. The Java 5 agents are on the bootstrap classpath and so are never woven and I think that Java is it may also be  My first fix allows not weaving, but I needed to add some additional logic to prevent trying to weave before the ClassLoaderWeavingAdaptor has been fully initialized.

With the attached patch, I can start up and weave classes into Weblogic running on a JRockIt 1.4.2_08 VM.
Comment 3 Ron Bodkin CLA 2006-01-04 02:53:39 EST
Created attachment 32450 [details]
Patch to loadtime module to fix problems weaving on older JRockIt VM
Comment 4 Ron Bodkin CLA 2006-01-04 02:59:08 EST
Created attachment 32451 [details]
Patch to weaver module to fix problems weaving on older JRockIt VM
Comment 5 Matthew Webster CLA 2006-06-05 11:42:32 EDT
The problem here is that we are trying to weave the contents of aspectjweaver.jar which should be avoided altogether. The classloader used is entirely at the discretion of the user rather than being dependent on the JVM e.g. the aj5.bat launcher uses –javaagent and aspectjweaver.jar is loaded from CLASSPATH. I suspect the difference between Sun and JRockit lies with how/when the agent is initialized: either a startup or on first reference. We must avoid weaving _any_ AspectJ classes because of potiential ClassCircularityErrors but clearly the existing mechanism in WeavingAdaptor.shouldWeave() comes too late. There are several approaches:
1.	Use a classloader that performs no weaving i.e. the bootstrap loader but modifying bootclasspath is either frowned upon or prohibited.
2.	Use CodeSource (obtained from ProtectionDomain) passed on a modified preProcess() method  to identify those classes loaded from the same URL as Aj. Unfortunately the com.bea.jvm.ClassPreProcessor does not supply this information.
3.	Perform no weaving on the classloader used to define Aj/JRockitAgent/ClassPreProcessorAgentAdapter. This would require a change to aj5.
4.	Simply exclude classes whose names begin “org.aspectj.” but much earlier. This only works if we rename any classes we ship.

Patch 32450 uses option #4. Why did you find it necessary to add the addional logic?
Comment 6 Ron Bodkin CLA 2006-06-06 01:04:43 EDT
I think you're right here Matthew: it's enough to just exclude weaving into org/aspectj types earlier in the cycle. However, Patch 32451 has most of the logic to actually exclude weaving earlier in the process whereas 32450 just comments out the test when it's too late. I probably started off with the logic to handle weaving while being initialized and then fell back on adding the earlier check in Aj.

I tested using -Xmanagement on JRockIt 1.4.2 with just the logic to exclude AspectJ classes in Aj instead of the WeavingAdaptor, i.e., without the logic to detect "am I initializing" and it worked for a version of GlassboxInspector on Tomcat 4.1.x.

Let's leave bug 140709 to track any possible need of handling self-weaving while initializing and apply the rest of these patches so that the JRockIt agent works properly.
Comment 7 Matthew Webster CLA 2006-06-06 04:10:55 EDT
Reference to BEA JRockit JMAPI: http://edocs.bea.com/jrockit/docs142/jmapi/javadoc/Management%20API/index.html
Comment 8 Matthew Webster CLA 2006-06-06 09:34:53 EDT
I am convinced that JVMTI has built-in recursion detection, something that JRockit JMAPI seems to lacks. If I trace calls to ClassPreProcessorAgentAdapter.transform() when using the agent to weave HelloWorld the first class I see (from CLASSPATH) is HelloWorld. Some AspectJ classes are loaded before HelloWorld e.g. org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor but those that are the cause of this bug e.g. org.aspectj.bridge.IMessage$Kind are loaded later but never passed to the agent. Subsequently classes like org.aspectj.runtime.reflect.Factory _are_ passed to the agent but filtered by the existing mechanism. 

[Opened C:\jdk1.5.0_05\jre\lib\rt.jar]
[Opened C:\jdk1.5.0_05\jre\lib\jsse.jar]
[Opened C:\jdk1.5.0_05\jre\lib\jce.jar]
[Opened C:\jdk1.5.0_05\jre\lib\charsets.jar]
[Loaded java.lang.Object from C:\jdk1.5.0_05\jre\lib\rt.jar]
...
[Loaded org.aspectj.weaver.loadtime.Agent from file:/C:/workspaces/org.aspectj-Ron_LTW/loadtime5/bin/]
[Loaded java.lang.UnsupportedOperationException from C:\jdk1.5.0_05\jre\lib\rt.jar]
[Loaded sun.reflect.NativeMethodAccessorImpl from C:\jdk1.5.0_05\jre\lib\rt.jar]
[Loaded sun.reflect.DelegatingMethodAccessorImpl from C:\jdk1.5.0_05\jre\lib\rt.jar]
[Loaded org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter from file:/C:/workspaces/org.aspectj-Ron_LTW/loadtime5/bin/]
[Loaded org.aspectj.weaver.loadtime.ClassPreProcessor from file:/C:/workspaces/org.aspectj-Ron_LTW/loadtime/bin/]
[Loaded java.lang.ExceptionInInitializerError from C:\jdk1.5.0_05\jre\lib\rt.jar]
[Loaded org.aspectj.bridge.context.CompilationAndWeavingContext from file:/C:/workspaces/org.aspectj-Ron_LTW/bridge/bin/]
...
? ClassPreProcessorAgentAdapter.transform() loader=sun.misc.Launcher$AppClassLoader@92e78c, className=hello/HelloWorld
...
[Loaded org.aspectj.bridge.IMessage from file:/C:/workspaces/org.aspectj-Ron_LTW/bridge/bin/]
[Loaded org.aspectj.bridge.IMessageHandler from file:/C:/workspaces/org.aspectj-Ron_LTW/bridge/bin/]
[Loaded org.aspectj.weaver.tools.GeneratedClassHandler from file:/C:/workspaces/org.aspectj-Ron_LTW/weaver/bin/]
[Loaded org.aspectj.weaver.ReferenceTypeDelegate from file:/C:/workspaces/org.aspectj-Ron_LTW/weaver/bin/]
[Loaded org.aspectj.weaver.AbstractReferenceTypeDelegate from file:/C:/workspaces/org.aspectj-Ron_LTW/weaver/bin/]
[Loaded org.aspectj.weaver.bcel.BcelObjectType from file:/C:/workspaces/org.aspectj-Ron_LTW/weaver/bin/]
[Loaded org.aspectj.weaver.AnnotatedElement from file:/C:/workspaces/org.aspectj-Ron_LTW/weaver/bin/]
[Loaded org.aspectj.weaver.TypeVariableDeclaringElement from file:/C:/workspaces/org.aspectj-Ron_LTW/weaver/bin/]
[Loaded org.aspectj.weaver.UnresolvedType from file:/C:/workspaces/org.aspectj-Ron_LTW/weaver/bin/]
[Loaded org.aspectj.weaver.ResolvedType from file:/C:/workspaces/org.aspectj-Ron_LTW/weaver/bin/]
[Loaded org.aspectj.weaver.ReferenceType from file:/C:/workspaces/org.aspectj-Ron_LTW/weaver/bin/]
[Loaded org.aspectj.weaver.loadtime.IWeavingContext from file:/C:/workspaces/org.aspectj-Ron_LTW/loadtime/bin/]
[Loaded org.aspectj.weaver.ICrossReferenceHandler from file:/C:/workspaces/org.aspectj-Ron_LTW/weaver/bin/]
[Loaded org.aspectj.weaver.reflect.IReflectionWorld from file:/C:/workspaces/org.aspectj-Ron_LTW/weaver/bin/]
[Loaded org.aspectj.weaver.ltw.LTWWorld from file:/C:/workspaces/org.aspectj-Ron_LTW/weaver/bin/]
[Loaded java.lang.reflect.InvocationTargetException from C:\jdk1.5.0_05\jre\lib\rt.jar]
[Loaded org.aspectj.bridge.MessageWriter from file:/C:/workspaces/org.aspectj-Ron_LTW/bridge/bin/]
[Loaded org.aspectj.weaver.tools.WeavingAdaptor$WeavingAdaptorMessageHandler from file:/C:/workspaces/org.aspectj-Ron_LTW/weaver/bin/]
[Loaded org.aspectj.bridge.AbortException from file:/C:/workspaces/org.aspectj-Ron_LTW/bridge/bin/]
[Loaded java.io.PrintWriter from C:\jdk1.5.0_05\jre\lib\rt.jar]
[Loaded org.aspectj.bridge.IMessage$Kind from file:/C:/workspaces/org.aspectj-Ron_LTW/bridge/bin/]
[Loaded org.aspectj.bridge.IMessage$1 from file:/C:/workspaces/org.aspectj-Ron_LTW/bridge/bin/]
...
? ClassPreProcessorAgentAdapter.transform() loader=sun.misc.Launcher$AppClassLoader@92e78c, className=org/aspectj/runtime/reflect/Factory
...

I think the solution is to add recursion protection to JRockitAgent, something that I have already done for WeavingURLClassLoader which is used both in the harness and AJDT LTW support (for both JDK 1.4 and 1.5).
Comment 9 Ron Bodkin CLA 2006-06-06 10:25:20 EDT
That sounds like a good approach to me. Thanks!
Comment 10 Matthew Webster CLA 2006-06-07 06:22:19 EDT
An article on writing a JRockit ClassPreProcessor with a nice sample implementation : http://dev2dev.bea.com/pub/a/2004/01/class_preprocessing.html
Comment 11 Matthew Webster CLA 2006-06-07 10:07:45 EDT
1. Re-implemented JRockitAgent using recursion protection
2. Removed “loadtime” dependency on managementapi-jrockit81.jar and implemented to the necessary JRockit classes to aid testing
3. Added JRockitAgentTest with from-scratch class loader to test recursion protection
4. Relaxed "catch (Throwble)" to "catch (Exception)" in Aj.preProcess() to protect agent users against weaver problems but allow reporting of unrecoverable errors.

My only concern with the recursion protection relates to around closure generation. When these are defined dependencies that have not yet been loaded may be passed to the weaver. This causes recursion in the agent/adaptor (although not in the weaver itself) which with the new agent may result in certain closures not being woven.

Awaiting JRockit testing.

Comment 12 Ron Bodkin CLA 2006-06-07 10:15:07 EDT
That sounds great. Should I sync to head and build a copy to test it?
Comment 13 Matthew Webster CLA 2006-06-07 10:19:02 EDT
1. Re-implemented JRockitAgent using recursion protection
2. Removed “loadtime” dependency on managementapi-jrockit81.jar and implemented to the necessary JRockit classes to aid testing
3. Added JRockitAgentTest with from-scratch class loader to test recursion protection
4. Relaxed "catch (Throwble)" to "catch (Exception)" in Aj.preProcess() to protect agent users against weaver problems but allow reporting of unrecoverable errors.

My only concern with the recursion protection relates to around closure generation. When these are defined dependencies that have not yet been loaded may be passed to the weaver. This causes recursion in the agent/adaptor (although not in the weaver itself) which with the new agent may result in certain closures not being woven.

Awaiting JRockit testing.
Comment 14 Matthew Webster CLA 2006-06-09 06:48:58 EDT
Ron: 

Good news: I just installed it in Tomcat running against JRockit 1.4.2 and it was able to start up and weave aspects as required. I will do more testing, but the first smoke test worked well (and fails with 1.5.1a or recent dev builds).
Comment 15 Matthew Webster CLA 2006-06-09 06:49:30 EDT
Great
Are we sure the thread local stack approach in there has no side effect when classloading gets into this recursive behavior ? Seems like if there is recursion, we won't weave the class at all since we 'll return bytecode from this thread local stack - which is fine if we assume the weaver only is the root cause of the recursion. 
Noone came across this in AspectWerkz - so I guess that 's because we had a slightly different weaver initialisation behavior

Alex
Comment 16 Matthew Webster CLA 2006-06-09 08:22:06 EDT
The only reason for recursion is class loading while weaving using the class loader that actually defines the weaver. This can happen at any point, not just during initialization. It cannot and should not happen while resolving types necessary to weave a class: until now these have been loaded using getResourceAsStream() and with LTWWorld Class.forName is used only for bootstrap classes and these are exluded from weaving in Aj.preProcess(). I do not believe that the weaver is re-entrant.

One issue previously noted concerns generated closures and will only be potential a problem for non-inlined around advice applied to classes loaded by the same loader used by the weaver. My advice is don’t weave classes on the same classpath as AspectJ!
Comment 17 Matthew Webster CLA 2006-06-09 08:23:25 EDT
Awaiting build.
Comment 18 Matthew Webster CLA 2006-06-12 10:18:08 EDT
Fix available