-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Morten Andersen-Gott opened SPR-4566 and commented
Using the applicationContext below, BeanCurrentlyInCreationException is thrown on application startup. If I remove the aop-config element, the application starts fine and I am able to execute both services.
The use of aop on both components seems perfectly legit to me, especially if the aspects are performing logging. The issue has been raised in several threads in the forum as well:
http://forum.springframework.org/showthread.php?p=168972
http://forum.springframework.org/showthread.php?t=45411
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<bean id="serviceA" class="com.test.ServiceAImpl">
<property name="serviceB" ref="serviceB"/>
</bean>
<bean id="serviceB" class="com.test.ServiceBImpl">
<property name="serviceA" ref="serviceA"/>
</bean>
<bean id="traceInterceptor" class="com.test.TraceInterceptor">
</bean>
<aop:config>
<aop:pointcut id="allServiceMethods" expression="execution(* com.test..*.*(..))"/>
<aop:advisor advice-ref="traceInterceptor" pointcut-ref="allServiceMethods" />
</aop:config>
</beans>
Affects: 2.0.7, 2.5.2
Attachments:
- beanInCreationException.zip (2.46 kB)