I am trying to configure AspectJ load time weaving and I need to weave a spring managed bean. This is because unfortunately the spring bean I'm interested in is in a third party library and has no null constructor so I can't use spring AOP.
My load-time-weaving Aspect is working for some classes in the same package as the class i'm really interested in. So I think I am hitting the problem that the bean class has been eagerly loaded before it can be loaded in the TomcatInstrumentableClassLoader
I've seen warnings about this in questions such as:
(a) AspectJ load time weaving not working for Spring beans
But it's not clear whether this is something you can work around - if you have the smarts. It sounds like it may be in link (a): There is the suggestion of creating two config classes and making sure one is loaded first. Is that possible with xml context configuration files. We are using xml configuration for our beans. Perhaps enforcing order of spring config files is only possible in java config? For this profiling project i can't change all our bean config unfortunately.
I've tried setting default-lazy-init="true" in the beans element in all our context files, but that didn't work sadly.
Is there anything else I can try? Even if it's quite tricky.