• Post Reply Bookmark Topic Watch Topic
  • New Topic

rmi  RSS feed

 
Dawud K.
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to call a server method from the client, and pass it a client object. The problem is that, when sending the object, it has to be an interface. So rather than sending type "Client" i would send type "ClientInterface". Now, on the server side, I try to cast the type ClientInterface back to Client and it doesnt work.

If i dont try casting it back, i get the following exception:

java.lang.IllegalArgumentException: argument type mismatch

Whats the problem?
Thanks.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Dawud K." -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy. User names cannot be obviously fake and must constist of a first name and a last name.

You can change your user name here.

There should be no need to cast your "ClientInterface" object to a "Client" if the interface/implementation is designed correctly.

Getting an IllegalArgumentException is certainly a strange error to be getting for this, too... is it possible to post the code around where this error is being thrown?

Thanks! and welcome to the JavaRanch!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!