0
这个配置的问题可能会导致异常?为一个bean创建一个会话范围的代理
java.lang.IllegalStateException: Cannot create scoped proxy for bean 'scopedTarget.testProxy': Target type could not be determined at the time of proxy creation.
<bean id="test" class="com.testsession.Test" scope="prototype" />
<bean id="testProxy" class="org.springframework.aop.framework.ProxyFactoryBean" scope="session">
<property name="target" ref="test" />
<property name="proxyInterfaces"><value>com.testsession.TestIface</value></property>
<aop:scoped-proxy/>
</bean>
testProxy
的豆通过会话范围MVC控制器请求。是不是proxyInterfaces
属性中指定的目标类型?
谢谢。我使用ProxyFactoryBean的原因是我需要修改Test bean(实际上是JaxWsPortProxyFactoryBean),使用拦截器(可以在BindingProvider中放入用户名/密码)。你能告诉我如何使用你提供的样品吗? – Industrious
@Industrious我已经添加了如何显式配置代理的示例,而不使用'aop:scoped-proxy' –