Permalink
Browse files

Reproduce SPR-8639 failure in anticipation of fix

This change re-introduces ProxyFactoryBean usage to demonstrate the
issue described in the previous commit.  Notice that debug logging is
enabled.  The following log statement documents 'ignoring' (suppressing)
the underlying exception.

To fix this issue, we'll see about allowing this exception to propagate
when dealing with ProxyFactoryBeans that do not have a fixed object type
that can be determined by static generics analysis or a call to
getObjectType on an early FactoryBean reference.

DEBUG: org.springframework.beans.factory.support.DefaultListableBeanFactory
- Ignoring bean creation exception on FactoryBean type check:
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'b' defined in class path resource
[org/springframework/issues/ReproTests-context.xml]: Cannot create inner
bean 'org.springframework.issues.B#7e9ffe3f' of type
[org.springframework.issues.B] while setting bean property 'target';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.issues.B#7e9ffe3f'
defined in class path resource
[org/springframework/issues/ReproTests-context.xml]: Cannot resolve
reference to bean 'c' while setting bean property 'c'; nested exception
is org.springframework.beans.factory.BeanCurrentlyInCreationException:
Error creating bean with name 'c':
org.springframework.beans.factory.FactoryBeanNotInitializedException:
Cannot determine target class for proxy

Issue: SPR-8639
  • Loading branch information...
1 parent e2f5175 commit 03d978fadd53ec54a3986a92edb94e27251fd5f6 @cbeams cbeams committed Sep 13, 2011
Showing with 20 additions and 10 deletions.
  1. +20 −10 SPR-8639/src/test/resources/org/springframework/issues/ReproTests-context.xml
@@ -7,22 +7,32 @@
<context:annotation-config/>
- <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
- <property name="interceptorNames" value="myInterceptor"/>
- <property name="beanNames" value="a,b,c"/>
- </bean>
-
<bean id="myInterceptor" class="org.springframework.issues.MyInterceptor"/>
- <bean id="a" class="org.springframework.issues.A">
- <property name="c" ref="c"/>
+ <bean id="a" class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="target">
+ <bean class="org.springframework.issues.A">
+ <property name="c" ref="c"/>
+ </bean>
+ </property>
+ <property name="interceptorNames" value="myInterceptor"/>
</bean>
- <bean id="b" class="org.springframework.issues.B">
- <property name="c" ref="c"/>
+ <bean id="b" class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="target">
+ <bean class="org.springframework.issues.B">
+ <property name="c" ref="c"/>
+ </bean>
+ </property>
+ <property name="interceptorNames" value="myInterceptor"/>
</bean>
- <bean id="c" class="org.springframework.issues.C"/>
+ <bean id="c" class="org.springframework.aop.framework.ProxyFactoryBean">
+ <property name="target">
+ <bean class="org.springframework.issues.C"/>
+ </property>
+ <property name="interceptorNames" value="myInterceptor"/>
+ </bean>
<!-- will be @Autowired into C -->
<bean id="d" class="org.springframework.issues.D"/>

0 comments on commit 03d978f

Please sign in to comment.