JAVA RMI客户端

时间:2012-09-07 21:33:46

标签: java rmi

我遇到的问题是,当我点击Eclipse中的“运行”按钮时,我的RMI应用程序客户端无法正常工作。它抛出以下异常:

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)
...

我在互联网上查看,当从eclipse生成JAR时,人们似乎遇到了这个问题。但是我的(蚂蚁建造的)罐子工作得很好,就在Eclipse内部,它没有按照它应该做的那样!

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

1 个答案:

答案 0 :(得分:0)

我找到了一个解决方案,在启动rmiregistry服务器之前,我必须使用“set CLASSPATH =”清理java类路径

c:>设置CLASSPATH =

c:> rmir​​egistry中

相关问题