发表于: 2017-08-21 23:35:32
2 962
今天完成的事情:
在本地配置的SpringRMI正常运行,但是在服务器上就运行失败,这个错误应该是连接不到服务器
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.how2java.service.CategoryService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
这是服务端
<bean id="categoryServiceImpl" class="com.how2java.service.impl.CategoryServiceImpl" scope="prototype"/>
<bean class="org.springframework.remoting.rmi.RmiServiceExporter">
<property name="serviceName" value="aa"/>
<property name="service" ref="categoryServiceImpl"/>
<property name="serviceInterface" value="com.how2java.service.CategoryService"/>
<property name="registryPort" value="1199"/>
</bean>
这是客户端的配置
<bean class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
<property name="serviceUrl" value="rmi://67.209.178.40:1199/aa"/>
<property name="serviceInterface" value="com.how2java.service.CategoryService"/>
</bean>
本地运行正常
遇到的困难:
以上,网上的都是helloworld,增删扒抄技能无处施展...
收获:
无
明日计划:
继续搞
评论