My Photo

August 2007

Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

« Article Announcing Glassbox Inspector: AOP Performance Management | Main | before() : christmas() { release(); } »

October 01, 2005

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83474ca6b69e200d8345d206c53ef

Listed below are links to weblogs that reference Load-Time Weaving for WebSphere Available:

Comments

bertrand AVE

I am very interested with this WebSphere plugin.

I am working with WebSphere v5.0 and WebSphere 5.1 and I would like to use load time weaving.

I have followed your steps in order to integrate your plugin into WAS.

I would like to log some events within a servlet.

This is what I have done:

steps 1: I have created an Aspect class in order to catch each doGet method.
steps 2: I have created an aop.xml file and added a system properties named aj5.def (this system property points to the xml.file).
steps 3: I have added my aspect class to the classpath.

I am sure that the WebSphere Plugin is called because I have put some trace in it.
But my aspect is never called, am I doing something wrong ?

Ron Bodkin

Hi Bertrand,

I'd love to see the code for your aspect so I can analyze what might be going wrong. Could you send it to me at rbodkin AT NOSPAMnew aspects.com?

Matthew Smith

Ron,

Your ClassLoader Plugin works great on Websphere 5.1.

Now that we've got load-time weaving working in the server, we also need it outside the server for some unit tests. this is with the IBM JDK 1.4. I've tried using the WeavingURLClassLoader that comes with aspectj, but there seems to be a problem with the generated closures in around advice (the parent classloader requests they be loaded from disk regardless of the fact that they are cached). Have you encountered this? Any ideas?

Ron Bodkin

Hi Matthew,

I know that the problem can occur in the JSP ClassLoader. I believe that what is happening is that the WebSphere JasperLoader does not look for predefined classes: it checks to see if there is a source file for any class being defined and if it is out of date it either recompiles or if missing assumes the source was deleted. So I don't think there's any way to define generated closures in that ClassLoader. I don't have a copy of WAS 5.1 to test with but that is my best guess.

Do you see this just with the JSP ClassLoader?

For the Glassbox Inspector we are working around the problem by not using around advice that generates a closure. If you can do so, that's the easiest way.

Otherwise, it might be possible to build a custom extension to AspectJ for WebSphere that would use a different strategy for weaving (defining a generated class and interface in the parent ClassLoader and using this in the child ClassLoader), but it would take a bit of effort.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment