带有IP的RMI-ClassNotFoundException、UnmarshaleException、ServerException

带有IP的RMI-ClassNotFoundException、UnmarshaleException、ServerException,ip,rmi,classnotfoundexception,Ip,Rmi,Classnotfoundexception,有谁可以帮助我建立使用ip的rmi服务器。我已经在网上搜索了好几天了,但还是没能解决我的问题 客户 public static void main(String[] agrcs) throws RemoteException, NotBoundException, MalformedURLException { if (System.getSecurityManager() == null) { System.setProperty("java.security.policy",

有谁可以帮助我建立使用ip的rmi服务器。我已经在网上搜索了好几天了,但还是没能解决我的问题

客户

public static void main(String[] agrcs) throws RemoteException, NotBoundException, MalformedURLException {
    if (System.getSecurityManager() == null) {     System.setProperty("java.security.policy", "F:\\škola\\pg2\\LodeSemestralka\\java.policy");

        System.setSecurityManager(new RMISecurityManager());
    }
    String ip = agrcs[0];
    Integer port = new Integer(agrcs[1]);

        server = (ShipServer) Naming.lookup("//"+ip+":"+port+"/"+SERVER_NAME);
}
服务器

static public void main(String[] agrcs) throws RemoteException {
    if (System.getSecurityManager() == null) {
        System.setProperty("java.security.policy", "F:\\škola\\pg2\\LodeSemestralka\\java.policy");
        System.setSecurityManager(new RMISecurityManager());
    }

    String ip = agrcs[0];
    Integer port = new Integer(agrcs[1]);

    playground = new Playground();
    try {
        Naming.bind("//" + ip + ":" + port + "/" + SERVER_NAME, playground);
    } catch (Exception ex) {
        playground = null;
        ex.printStackTrace();
    }
当服务器被调用时,它抛出

java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    java.lang.ClassNotFoundException: lode.gameCore.Playground
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:413)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at sun.rmi.transport.Transport$1.run(Transport.java:174)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:377)
    at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
    at java.rmi.Naming.bind(Naming.java:128)
    at server.Server.main(Server.java:38)
    at lode.game.StartUpScreen.createNewGame(StartUpScreen.java:186)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAction.java:662)
    at org.jdesktop.application.ApplicationAction.actionPerformed(ApplicationAction.java:698)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
    at java.awt.Component.processMouseEvent(Component.java:6504)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
    at java.awt.Component.processEvent(Component.java:6269)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4860)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4686)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2713)
    at java.awt.Component.dispatchEvent(Component.java:4686)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
    at java.awt.EventQueue.access$000(EventQueue.java:101)
    at java.awt.EventQueue$3.run(EventQueue.java:666)
    at java.awt.EventQueue$3.run(EventQueue.java:664)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:680)
    at java.awt.EventQueue$4.run(EventQueue.java:678)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at ....
gameCore是公共接口ShipServer扩展了远程{…},公共类实现了ShipServer,可序列化{…}

我使用的是LocalRegistry,它工作得很好,但只在一台PC上运行。我需要应用程序在更多的PC上运行,使用RMI和IP通过网络进行通信等

在java.policy中是grant{permission java.security.AllPermission;}

RMI注册表的类路径中没有该类。注册表需要远程接口、存根(如果有)以及它们所依赖的任何应用程序类,等等,直到关闭为止

java.lang.ClassNotFoundException: lode.gameCore.Playground(Unknown Source)
    ...
    at java.rmi.Naming.bind(Naming.java:128)