ClassCastException

Hello ,

i am new to the RMI programming. i have created my application, the client the server and the interface. when i am trying to run the client which is suppose to send a user-defined class type object the server for the server to send it to the DB, i am getting java.lang.ClassCastException : MainServer_stub. MainServer is the name of my server.

Any help

[380 byte] By [bezgodoa] at [2007-11-26 17:48:27]
# 1
You are probably trying to cast the result of a lookup to MainServer. Cast it to the remote interface that MainServer implements.
ejpa at 2007-7-9 5:00:49 > top of Java-index,Core,Core APIs...
# 2
-Move interfaces to a common package between server&client.
thexeromea at 2007-7-9 5:00:49 > top of Java-index,Core,Core APIs...
# 3
Or at least make sure the remote interfaces are the same at server and client, not similar but in different packages.
ejpa at 2007-7-9 5:00:49 > top of Java-index,Core,Core APIs...
# 4
Thanks man that was the problem.Thanks to everybody!!!You are good!!!!!!
bezgodoa at 2007-7-9 5:00:49 > top of Java-index,Core,Core APIs...