-
Feb 18th, 2008, 11:12 PM
#1
aop:config conflicting with annotation based autowiring
Hi All,
I have recently tried to implement an aspect over my service layer using acegi security and have found that introducing the following config breaks my existing autowiring...
<aop:config>
<aop:aspect id="applicationSecurityAspect" ref="applicationSecurity">
<aop
ointcut id="applicationSecurityPointCut"
expression="execution(* com.mycompany.myapp.core.*.application.spi.*(..) )" />
</aop:aspect>
</aop:config>
I'm using a combination of @Component, @Service and @Repository annotations plus <context:component-scan ... /> config to wire up my application. I use @Autowired for constructor injection. Spring version is 2.5.1.
Until I tried to introduce an aspect into the mix things were working well. As soon as I introduce the <aop:config stuff my app tells me I have unsatisfied dependencies in beans far removed from the stuff i'm trying to auto proxy. In fact I only have to introduce the following for it to break...
<aop:config>
</aop:config>
I don't know exactly how this config effects the loading of bean definitions. I'm assuming it must introduce some proxying and this is conflicting with the autwiring and component scanning.
Another observation is this...
If I try configuring it using a ProxyFactoryBean I get identical behaviour.
thanks,
Rob
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules