user1189269
user1189269

Reputation: 25

JAVA: RMI method error: java.lang.NoSuchMethodError

I'm getting this error while executing the method chat in RMI:

    ...
    case talk:
    if(param!=null)
    {
       System.out.println("What do you want to say to "+param+"?");
       String msg=br.readLine();
       String room=myPG.getCurrentRoom();
       utils.chat(room,param,msg);
    }
    else
       System.out.println("Wrong usage: e.g. talk Ciccio");
    break;
    ...

The implementation of RMI method is very simple... but the error comes before entering into the method:

public void chat(String room,String name,String msg) throws RemoteException
    {
        System.out.println(room+name+msg);
    }

The error is:

Exception in thread "main" java.lang.NoSuchMethodError: pgUtils.PGUtilsInterface.chat(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

EDIT: the remote object utils works fine with all the other remote methods that i use in my application, so... don't know what's happening.

Upvotes: 2

Views: 1680

Answers (1)

Ernest Friedman-Hill
Ernest Friedman-Hill

Reputation: 81724

It's just a versioning error. The *.class file being used on one end of the connection doesn't have the method; you just need to do a bit of cleanup and try again.

Upvotes: 2

Related Questions