This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • 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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!