你的rmiregistry也要知道哪里去找这些东西

解决方案 »

  1.   

    就是:在你启动rmiregistry之前,将你的*.jar加到classpath中。最好是在rmi 服务程序中启动registry,这样就不会出现你的问题了(为什么?),方法:
    Registry reg = null;
    int port = xxxx;try {
        reg = LocateRegistry.createRegistry(port);
    }
    catch(Exception e) {
        e.printStackTrace();
    }//bind
    reg.bind("name",objectreference);
      

  2.   

    Note that before you start the rmiregistry, you must make sure that the shell or window in which you will run rmiregistry either has no CLASSPATH environment variable set or has a CLASSPATH environment variable that does not include the path to any classes, including the stubs for your remote object implementation classes, that you want downloaded to clients of your remote objects. //Tutorial中是这么说的,我已经保证启动rmiregistry时不加任何有关rmi的东西了.可是咳异常.
      

  3.   

    怎么同样的代码在单位机器上就bind上了,我家里的机器虽然是没联网,但是有网卡,自己配置了IP,并且启动时让网卡生效,单位的是个拥有外部IP的配置,绑订用的同样是Naming.rebind("/GradingService", gService);,客户端Naming.lookup("//localhost/GradingService");这个就能成功的远程调用?为什么啊??郁闷.
      

  4.   

    思乐的书也会有问题?我也遇到过如上问题,
    我在我的环境变量里加入RMI程序所在包的路径,才解决的。
    你try把。