Exception in thread "main" java.rmi.ConnectException: Connection refused to host: 192.168.1.55; nested exception is: -
i run code in system , don't weather write localaddress(localhost) or remote addres(ip address)...
ref= (rmisintf)naming.lookup("rmi://"+"192.168.0.15"+"/rmiserver");
and try code till no response
ref= (rmisintf)naming.lookup("rmi://"+"localhost"+":"+8033+"/rmiserver"); //myremoteobject ro = (myremoteobject) naming.lookup("//" + "localhost" + ":" + port + "/" + name); //ref=naming.rebind("rmi://localhost:8080/rmiserver",rmisintf);
it test first localhost easy , not require set rules remote connection i.e. external address.
the java rmi faq says,
the appropriate workaround set system property java.rmi.server.hostname when starting server. value of property should externally reachable hostname (or ip address) of server -- whatever works when specified host-part in naming.lookup enough.
also have @ properties remote method invocation here.
Comments
Post a Comment