All pastes #350583 Raw Edit

Someone

public java v1 · immutable
·published 2007-02-11 15:47 UTC
rendered paste body
/* Error:Client exception: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:         java.lang.ClassNotFoundException: LansinTVserver.RMIjava.rmi.UnmarshalException: error unmarshalling return; nested exception is:         java.lang.ClassNotFoundException: LansinTVserver.RMI        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)        at LansinTVclient.MainFrame$2.run(MainFrame.java:289)*/                System.setProperty("java.security.policy", "c:/policy.txt");                if (System.getSecurityManager() == null)                    System.setSecurityManager(new RMISecurityManager());                Properties env = new Properties();                env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");                env.setProperty("java.naming.provider.url", "localhost:1099");                                //context = new InitialContext(env);                                                                                                try {                    Registry registry = LocateRegistry.getRegistry("192.168.1.201");                    RMI stub = (RMI) registry.lookup("MyRMI");                    System.err.println("Debug");                    int response = stub.sayHello(4, 6);                    System.out.println("response: " + response);                } catch (Exception e) {                    System.err.println("Client exception: " + e.toString());                    e.printStackTrace();                }// My RMI Interface:import java.rmi.Remote;import java.rmi.RemoteException;public interface RMI extends Remote {    int sayHello(int a, int b) throws RemoteException;}