manning@biwabik.net (6) [Avatar] Offline
#1
<context:load-time-weaver/> multiple classloaders and class load order
I think it would be a good idea to have a warning in the section about LTW using the spring configuration rather than javaagent on two items:

1.) It will only instrument the same classloader as Spring is configured with. So if you are using shared libraries, utility classes from the system classpath etc., you will not get a chance to weave those classes.

2.) It will only instrument the classes loaded after Spring is configured. So if your application server has loaded classes for you already again you will not get a chance to weave those classes (although I've seen some talk about using jdk 1.6 to reload classes but that's getting complicated).

As a test with WebLogic 10.2, I created a web services project, created a simple web service that called two classes. One I made a static reference and the other I created during the call. The statically referred class was not woven and the other class was because WLS loads the web service class before spring is configured.
ramnivas (171) [Avatar] Offline
#2
Re: <context:load-time-weaver/> multiple classloaders and class load order
Good point. I will add this information to chapter 8.

Thanks.

-Ramnivas