속성 선택 가능한 전송 프로토콜과 함께 프록시 빈을 사용하고 있습니다. 내 문제는 빈 속성을 변환 할 수 없다는 것이지만, 나는 왜 그 이유를 모르겠다.봄에 프록시 객체를 연결하는 방법은 무엇입니까?
내 재산 : service.protocol = RMI
<!-- This is the 'multiplexing' factory bean (using this because properties
cannot be used in bean names and aliases -->
<bean name="dbFormGenWindowComponent"
class="org.springframework.beans.factory.config.BeanReferenceFactoryBean">
<property name="targetBeanName" value="dbFormGenWindowComponent-${service.protocol}invoker" />
</bean>
<!-- Here are the service invoker beans with two protocols: -->
<bean name="dbFormGenWindowComponent-rmiinvoker" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
<property name="serviceUrl" value="${ringwindow.serviceURL.rmi}/${ringwindow.service.name}-dbFormGenWindowComponent"/>
<property name="serviceInterface" value="foo.bar.service.formgen.windows.FormGenWindowComponent" />
<property name="lookupStubOnStartup" value="false"/>
</bean>
시작시 예외는 다음과 같습니다
org.springframework.beans.TypeMismatchException이 상황입니다 : [$ Proxy541] 유형의 속성 값을 필수 필드로 변환하지 못했습니다. 타입 [foo.bar.service.formgen.windows.FormGenWindowComponent] 속성 'formGenWindowComponent'에 대해 ; 상자의 예외는 java.lang.IllegalArgumentException가 없습니다 : 이 속성에 대해 [$ Proxy541] 필수 유형 [foo.bar.service.formgen.windows.FormGenWindowComponent] 에 유형 의 값을 변환 할 수 없습니다 'formGenWindowComponent' 일치 편집자 또는 변환 전략을 찾았습니다
중첩 된 factory bean은 잘 동작해야한다고 생각합니다. 이 일을하는 법을 알고 있습니까?
내가 언급 한 것을 확인했는데, 나의 프록시는 인터페이스의 그것들이고, 그들이 플러그인되어있는 빈들 또한 인터페이스를위한 getters/setter를 선언한다. 그러나 이것을 조사하면서 나는 나의 모든 BeanReferenceFactoryBeans가 동일한 프록시를 가리키며, 이것이 진짜 문제였습니다. 나는 모든 ClassCastExceptions가 매우 동일한 번호가 매겨진 프록시 객체에 대해 불평했음을 알아야한다. :-(친절한 도움을 주셔서 감사합니다! Bozho! – jb33