Announcement Announcement Module
Collapse
No announcement yet.
@Scope ( INTERFACES ) equivalent for XML Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Scope ( INTERFACES ) equivalent for XML

    Hi,

    I'm trying to do this (code) in old school xml.
    Code:
    @Bean
    	@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)	
    	public MyInterface createInterface() {
    	    return connectionRepository().getPrimaryConnection(MyInterface.class);
    	}
    I've tried to do this:
    Code:
    	<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:

    Code:
    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!
Working...
X