JAVA RMI Client

自作多情 提交于 2019-12-25 01:22:15

问题


I have the problem that my RMI Application Client isn't working when i hit the "run" Button in Eclipse. It throws the following exception:

java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
java.net.MalformedURLException: unknown protocol: rsrc
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
...

I looked on the internet and people seem to have that problem when generating JARs from eclipse. But my (ant-built) jars work fine, just inside Eclipse it's not doing as it should!

 InterfaceRemota objetoRemoto = (InterfaceRemota)Naming.lookup("//localhost:1097/ObjetoRemoto");

回答1:


I found a solution, before starting the rmiregistry server I have to clean the java classpath using "set CLASSPATH="

c: > set CLASSPATH=

c: > rmiregistry



来源:https://stackoverflow.com/questions/12325702/java-rmi-client

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!