English 中文(简体)
RMI Spring RMI 误差 java.lang.Class nonfoundFoundExplication: org. springframwork. remoting.rmi.RmiInpreactionHandler 。 错误的 RMI 错误 java. lang. Class nonfoundException: org. sringframwork. remoting.rmi. RmiInpetionHandler
原标题:Spring RMI error java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationHandler

我试图用 < code> spring 创造一些豆子并将其导出至马绍尔群岛...

这是我的代码:

<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” 的文件, 我正在用这个参数运行我的 VM, 但我仍然有这个错误 :

java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationHandler (no security manager: RMI class loader disabled)

我不知道该怎么办... 在Linux, 完全相同的项目运行正常(jdk 1. 7. 4) 但在窗户里没有... 在java 1.

<强度 > 编辑:

我的错误是:

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

提前向您致谢

问题回答

这里的要点不是安装一个安全经理,而是要找到课程。 您在部署中丢失了一些 JAR 文件 。

我不认为它仍然重要,但我个人今天面临同样的问题,无法找到答案。我在这里张贴,也许对某人有帮助。

解决方案 : 停止 < code> rmiregistry < /code > 程序, 或者通过 Spring jars 到 rmiregistry 和 -J 选项。 最简单的方式就是停止 rmiregistry, 允许 Spring 启动一个包含所有需要的班级的版本。 不要设置 < code> RMI 安全管理器

你需要把这个写进你的代码的一部分:

System.setSecurityManager(new RMISecurityManager());

你也可以另找一个安全经理 但只要安个安全经理就行了

事实上,我张贴的线条很容易在一个独立的桌面应用程序的主类中被解开,但我不确定您的情况。您应该寻找一个配置选项来做这个可能。

RMIServiceExpororter Spring RMIService Explorter, 正确管理马绍尔群岛注册处的最佳做法是使用RMIS注册程序。为了更好地让您理解,我贴上一个“Spring”配置的例子,用一个远程的Bean:

<bean id="RemoteServices" class="remote.RMIServicesImpl"/>
<bean id="RemoteRmiRegistry" class="org.springframework.remoting.rmi.RmiRegistryFactoryBean">
        <property name="alwaysCreate" value="true" />
        <property name="port" value="1093"></property>
</bean>
<bean class="org.springframework.remoting.rmi.RmiServiceExporter">
        <property name="service" ref="RemoteServices" />
        <property name="serviceInterface" value="remote.RemoteInterface" />
        <property name="serviceName" value="RemoteServices" />
        <property name="replaceExistingBinding" value="true"></property>
        <property name="registry" ref="RemoteRmiRegistry"></property>
    </bean>

这样,RmiReregistry Factory Bean 将自主管理所有关于RMI Socket 层的事情, 你不需要阻止JVM, 而是简单地调用它。

如果有效的话,请估价我





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签