小弟最近在学习远程方法调用(rmi),从网上搞了个简单例子,但就是调试不通,请大家看看,谢谢! java.lang.ClassNotFoundException: rmi.AddServerImpl_Stub这个是关键。检查生成的存根文件路径。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 AddServerImpl_Stub.class在D:\jakarta-tomcat-4.0.4\webapps\examples\WEB-INF\classes\rmi下,具体应该怎么做 http://www.51un.com/rmi.exe我以前学的时候做的一个示范例子 to;nova1980(新星)一样报错D:\rmi>newD:\rmi>echo off ================== # author:nova # date:2002/10/24 ================== . client端编译成功 . compute接口编译成功 . 服务器端编译成功 . ComputeEngine rmic成功ComputeEngine exception: Server RemoteException; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: engine.ComputeEngine_Stubjava.rmi.ServerException: Server RemoteException; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: engine.ComputeEngine_Stub at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350) at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source) at java.rmi.Naming.rebind(Naming.java:159) at engine.ComputeEngine.main(ComputeEngine.java:25)Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: engine.ComputeEngine_StubCaused by: java.lang.ClassNotFoundException: engine.ComputeEngine_Stub =============================================== 如果看到结果为3.14159265358979323846即执行成功 你可以更改输出的位数(默认设定为20) localhost为连接的地址 ================================================ComputePi exception: Computejava.rmi.NotBoundException: Compute at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350) at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) at java.rmi.Naming.lookup(Naming.java:83) at client.ComputePi.main(ComputePi.java:14) to:sangyei(冰峰)start jdk\bin\rmiregistry就这么直接运行吗?start rmiregistry和start jdk\bin\rmiregistry是一样的吧! 你的rmic没有成功你的classpath是否设置成功你这样测试下看可以不可以在D:\rmi下 执行,rmic engine.ComputeEngine如果不成功说明你的classpath有问题,,这样再执行:rmic -classpath d:\rmi engine.ComputeEngine -d d:\rmi 如果还有问题,,你分开执行runreg.bat:启动rmiregistry,并且打开runreg-secu.bat(runreg-secu.bat不用另行打开runreg-secu:在服务器端绑定engine.ComputeEngine(如果runreg.bat没有执行,则此命令无法执行成功)test.bat:测试RMI是否布置成功,可以打开修改参数 问题依旧没有解决大家可以以http://www.51un.com/rmi.exe(nova1980原创)为例讨论 问个java对象的问题 关于MVC模式概念的探讨 高手来啊 图片上传问题 关于JSP的数组 字符串问题【50分】,在线等!!! struts怎样实现上传下载功能 创建个包,出现了诡异的现象 ArtifactTransferException JAVA BEAN紧急求救,在线等待 使用response.sendRedirect(url)进行页面转换前进行了数据update到数据库!结果不能转到目标网页! servlet與sql200連接該怎麼??? 问一个关于线程和方法回调的问题? 在线高分求助:jsp中如何装载(.js)函数文件
一样报错
D:\rmi>newD:\rmi>echo off
==================
# author:nova
# date:2002/10/24
==================
.
client端编译成功
.
compute接口编译成功
.
服务器端编译成功
.
ComputeEngine rmic成功
ComputeEngine exception: Server RemoteException; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
java.rmi.ServerException: Server RemoteException; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
RemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:159)
at engine.ComputeEngine.main(ComputeEngine.java:25)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
ception is:
java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
Caused by: java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
===============================================
如果看到结果为3.14159265358979323846即执行成功
你可以更改输出的位数(默认设定为20)
localhost为连接的地址
================================================
ComputePi exception: Compute
java.rmi.NotBoundException: Compute
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
RemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:83)
at client.ComputePi.main(ComputePi.java:14)
start jdk\bin\rmiregistry
就这么直接运行吗?start rmiregistry和start jdk\bin\rmiregistry是一样的吧!
在D:\rmi下 执行,rmic engine.ComputeEngine如果不成功说明你的classpath有问题,,这样再执行:
rmic -classpath d:\rmi engine.ComputeEngine -d d:\rmi
test.bat:测试RMI是否布置成功,可以打开修改参数
大家可以以
http://www.51un.com/rmi.exe(nova1980原创)
为例讨论