java.lang.ClassNotFoundException: rmi.AddServerImpl_Stub
这个是关键。检查生成的存根文件路径。

解决方案 »

  1.   

    AddServerImpl_Stub.class在D:\jakarta-tomcat-4.0.4\webapps\examples\WEB-INF\classes\rmi下,具体应该怎么做
      

  2.   

    http://www.51un.com/rmi.exe我以前学的时候做的一个示范例子
      

  3.   

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

  4.   

    to:sangyei(冰峰)
    start jdk\bin\rmiregistry
    就这么直接运行吗?start rmiregistry和start jdk\bin\rmiregistry是一样的吧!
      

  5.   

    你的rmic没有成功你的classpath是否设置成功你这样测试下看可以不可以
    在D:\rmi下 执行,rmic engine.ComputeEngine如果不成功说明你的classpath有问题,,这样再执行:
    rmic -classpath d:\rmi engine.ComputeEngine -d d:\rmi
      

  6.   

    如果还有问题,,你分开执行runreg.bat:启动rmiregistry,并且打开runreg-secu.bat(runreg-secu.bat不用另行打开runreg-secu:在服务器端绑定engine.ComputeEngine(如果runreg.bat没有执行,则此命令无法执行成功)
    test.bat:测试RMI是否布置成功,可以打开修改参数
      

  7.   

    问题依旧没有解决
    大家可以以
    http://www.51un.com/rmi.exe(nova1980原创)
    为例讨论