配置文件不变:
<!-- 分类 -->
<bean id="commoCategoryServComponent" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
<property name="serviceUrl" value="${ecos_commodity_remote.url}/ICommoCategoryServComponent"/>
<property name="serviceInterface" value="org.lazicats.ecos.commodity.service.component.ICommoCategoryServComponent"/>
</bean>
<!-- 运营分类 -->
<bean id="categoryServComponent" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
<property name="serviceUrl" value="${ecos_commodity_remote.url}/IOperatingCategoryServComponent"/>
<property name="serviceInterface" value="org.lazicats.ecos.commodity.service.component.IOperatingCategoryServComponent"/>
</bean>
引用的java变动:
@Resource
private ICommoCategoryServComponent categoryServComponent;
but was actually of type [$Proxy7]
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productStockController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productStockViewComponentImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'categoryServComponent' must be of type [org.lazicats.ecos.commodity.service.component.ICommoCategoryServComponent], but was actually of type [$Proxy7]
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
下面就OK
@Resource
private ICommoCategoryServComponent commoCategoryServComponent;