I’m trying to do this (code) in old school xml.
@Bean
@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
public MyInterface createInterface() {
return connectionRepository().getPrimaryConnection(MyInterface.class);
}
I’ve tried to do this:
<bean id="myBean" class="a.b.c.MyInterface"
factory-bean="myFactory" factory-method="create"
scope="request">
<constructor-arg value="a.b.c.MyInterface"></constructor-arg>
<aop:scoped-proxy proxy-target-class="false"/>
</bean>
But i got:
Cannot convert value of type [$Proxy12 implementing java.io.Serializable,org.springframework.aop.scope.ScopedObject,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [a.b.c.MyInterface] for property ‘myBean’: no matching editors or conversion strategy found
Any ideas?
Thanks!
Here is how i finally got it working. skaffman was digging really close: