我正在尝试使用创建一些beanSpring
并将它们导出到RMI ...
这是我的代码:
<bean class="org.springframework.remoting.rmi.RmiServiceExporter">
<property name="serviceName" value="OfferService" />
<property name="service" ref="offerService" />
<property name="serviceInterface" value="ro.project.services.OfferService" />
<property name="registryPort" value="1199" />
</bean>
我在我的根文件夹中创建了一个名为“policy.all”的文件,我正在使用该参数运行我的虚拟机,但我仍然有这个错误:
java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationHandler (no security manager: RMI class loader disabled)
我不知道该怎么做......在linux中,完全相同的项目运行正常(使用jdk 1.7.0.4)但在windows中不是......在java 1.5(windows)中它正在工作......但在java 1.7中。 0.4(Windows)它不工作......
编辑:
我的错误是:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.rmi.RmiServiceExporter#0' defined in class path resource [spring/services.xml]: Invocation of init method failed; nested exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationHandler (no security manager: RMI class loader disabled)
添加此行后:
if (System.getSecurityManager() == null)
{
RMISecurityManager manager = new RMISecurityManager();
System.setSecurityManager(manager);
}
我有这个错误:
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring/application-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring/application-context.xml] cannot be opened because it does not exist
先感谢您