JAVA RMI 客户端 [英] JAVA RMI Client

查看:71
本文介绍了JAVA RMI 客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我在互联网上查看,人们在从 Eclipse 生成 JAR 时似乎遇到了这个问题.但是我的(蚂蚁构建的)罐子工作正常,只是在 Eclipse 中它没有按预期工作!

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");

推荐答案

我找到了一个解决方案,在启动 rmiregistry 服务器之前,我必须使用set CLASSPATH="

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

c:> 设置 CLASSPATH=

c: > set CLASSPATH=

c:> rmiregistry

c: > rmiregistry

这篇关于JAVA RMI 客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆