这个服务器上下文过去可以在 Spring 2 中正常工作:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="myService" class = "com.example.service.MyServiceFactory" factory-method="getInstance"/>
<bean class="org.springframework.remoting.rmi.RmiServiceExporter">
<property name="serviceName" value="MyService"/>
<property name="service" ref="myService"/>
<property name="serviceInterface" value="com.example.service.MyService"/>
<property name="registryPort" value="1199"/>
</bean>
</beans>
但是,当我切换到 spring 4.1.6-RELEASE 时,我收到了这个错误:
java.lang.IllegalArgumentException: Property 'service' is required
at org.springframework.remoting.support.RemoteExporter.checkService(RemoteExporter.java:114)
at org.springframework.remoting.rmi.RmiServiceExporter.prepare(RmiServiceExporter.java:239)
at org.springframework.remoting.rmi.RmiServiceExporter.afterPropertiesSet(RmiServiceExporter.java:230)
我该如何解决?