I'm having trouble getting AspectJ to perform load time weaving on a class annotated with @configurable in my main project. No fields get set and none of the setters are touched.
I don't think there's trouble with the configuration itself, because I've extracted the configuration and tested it on a smaller sandbox project. Just for the sake of it, I'll include it in this question though.
So, I'm wondering:
- Is there anything in the larger project that might be hindering Spring/AspectJ from detecting the this particular class?
- Is there any way of checking if spring is even aware of the class in questions?
And lastly, whatever code I can extract (please excuse the obfuscation):
From configuration XML:
<context:annotation-config />
<context:spring-configured />
<context:component-scan base-package="se.isydev" />
<context:component-scan base-package="se.istools" />
<aop:aspectj-autoproxy />
<context:load-time-weaver aspectj-weaving="on" />
<context:property-placeholder location="classpath:settings.properties" />
(...)
<bean class="com.company.ClassToBeWeaved"
scope="prototype">
<property name="injectedBean" ref="injectedBean" />
</bean>
And the class itself:
@Configurable
public class ClassToBeWeaved {
private InjectedBean injectedBean;
@Required
public void setInjectedBean() { ... }
}
Edit:
Well, turns out that it wasn't working due to a circular dependency. Oh deary me, I love working on legacy code. Still, my original questions remain.