when run rmi application it's working when try code on different pc different addresses getting error:
java.rmi.unmarshalexception: error unmarshalling return; nested exception is:
java.lang.classnotfoundexception: zz.interfce @ sun.rmi.registry.registryimpl_stub.lookup(unknown source) @ java.rmi.naming.lookup(unknown source) @ client$2.actionperformed(client.java:112) . . .
ok code : side of server
try { system.setproperty("java.security.policy","c:\\dernier\\src\\security.policy"); system.setsecuritymanager(new rmisecuritymanager()); registre = locateregistry.createregistry(integer.parseint(textport.gettext())); impliement obj=new impliement(); registre.rebind("hello1",obj); list1.add("serveur lisning"); cpt++; } catch (remoteexception e) { // todo auto-generated catch block e.printstacktrace(); }
side of client
try { user=txtun.gettext(); client=new client_implment(rsa,user); hello= (interfce) naming.lookup("rmi://"+textadressz.gettext()+":"+integer.parseint(txtport.gettext())+"/hello1"); hello.connecté((client_interfce)client,user,rsa.getn(),rsa.gete()); cpt++; } catch (remoteexception | malformedurlexception | notboundexception e) { // todo auto-generated catch block e.printstacktrace(); }
ps : application work's fine in localhoste
you've mis-stated problem. class isn't being found zz.interfce
. not stub. appears remote interface actually. needs deployed @ client. otherwise client can't anyway.