java - Error when calling remote method -


i'm trying call fibonacci method on remote server using rmi when try invoke method on client side giving method integer value, these errors:

java.rmi.serverexception: remoteexception occurred in server thread; nested exception is:     java.rmi.unmarshalexception: unrecognized method hash: method not supported remote object     @ sun.rmi.server.unicastserverref.dispatch(unknown source)     @ sun.rmi.transport.transport$1.run(unknown source)     @ sun.rmi.transport.transport$1.run(unknown source)     @ java.security.accesscontroller.doprivileged(native method)     @ sun.rmi.transport.transport.servicecall(unknown source)     @ sun.rmi.transport.tcp.tcptransport.handlemessages(unknown source)     @ sun.rmi.transport.tcp.tcptransport$connectionhandler.run0(unknown source)     @ sun.rmi.transport.tcp.tcptransport$connectionhandler.run(unknown source)     @ java.util.concurrent.threadpoolexecutor.runworker(unknown source)     @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source)     @ java.lang.thread.run(unknown source)     @ sun.rmi.transport.streamremotecall.exceptionreceivedfromserver(unknown source)     @ sun.rmi.transport.streamremotecall.executecall(unknown source)     @ sun.rmi.server.unicastref.invoke(unknown source)     @ java.rmi.server.remoteobjectinvocationhandler.invokeremotemethod(unknown source)     @ java.rmi.server.remoteobjectinvocationhandler.invoke(unknown source)     @ com.sun.proxy.$proxy0.fibonacciarraytest(unknown source)     @ ie.gmit.fibonacciclient.main(fibonacciclient.java:37) 

does have idea have gone wrong implementation?

this client side of rmi application:

      //get user input        scanner user_input = new scanner(system.in);       string fibmaxnum;        system.out.println("enter max fibonacci number: ");       fibmaxnum = user_input.next();         int fibmax = integer.parseint(fibmaxnum);       //get fibonacci array.      int[] sequence = power_proxy.fibonacciarraytest(fibmax);      (int value : sequence) {         system.out.println(value);      } 

and implementation on server side, error here the return type incompatible ipower.fibonacciarraytest(int).i gather i'm not specifying correct return type in ipower interface, how can correct signatures fix this? should change method in ipower :

   public int[] fibonacciarraytest(int n) {          int = 0;         int b = 1;         int[] sequence = new int[n];          // fill array fibonacci values.         (int = 0; < n; i++) {             sequence[i] = a;              int temp = a;             = b;             b = temp + b;         }         return sequence;         } 

the interface:

public interface ipower extends remote{       //declare available methods , must throw remoteexception        int[] fibonacciarraytest(int fibmax) throws remoteexception;  } 

you've changed remote method signature after deployment.

clean , rebuild , redeploy both client , server, not forgetting restart registry too.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -