本文主要是介绍Java RMI方式调用问题 but was actually of type [$Proxy7],希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
配置文件不变:
<!-- 分类 -->
<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;
这篇关于Java RMI方式调用问题 but was actually of type [$Proxy7]的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!