Hi,
Why is it that when I use the XML based approach to configure Load Time Weaving everything seems to work properly but when I used the Java Configuration approach my aspects never get weaved.
This works:
applicationContext.xml
<context:spring-configured /> <!-- I believe this declaration is not required since it is implicitly enabled when aspectj-weaving is used -->
<context:load-time-weaver aspectj-weaving="autodetect" />
and then
@Configurable
public class MyDomainClass {
...
}
This doesn't work.
@Configuration
@ComponentScan(...)
@PropertySource("classpath:spring.properties")
@Import({ CachingConfig.class, PersistenceConfig.class })
@EnableSpringConfigured
@EnableLoadTimeWeaving(aspectjWeaving=AspectJWeavi ng.AUTODETECT) //This is the default though I'm putting it here for clarity
public class RootConfig {
....
}
and then
@Configurable
public class MyDomainClass {
...
}
Is there anything that I'm missing?
Thanks.
-tony


Reply With Quote