Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help:basic RMI question

2 views
Skip to first unread message

Paolo De Lutiis

unread,
Mar 18, 1997, 3:00:00 AM3/18/97
to

Hi.
I'm writing an RMI client-server application. The code is divided into two
packa
ges:the server side and the client side.
When I try the client (applet) with appletviewer I get the following error:
myApplet exception: serverPackage.ServerClass_Stub
java.lang.ClassCastException: serverPackage.ServerClass_Stub
at clientPackage.myApplet.init(myApplet.java:line#)
at sun.applet.AppletPanel.run(AppletPanel.java:273) at java.lang.Thread.
at java.lang.Thread.run(Thread.java)


The rmiregistry, the server process ,the appletviewer are running on the
same machine.
The error is on the cast of the remote object to the server class type.
May you help me?
Thanks.
Paolo De Lutiis
--

Peter Jones - JavaSoft East

unread,
Mar 25, 1997, 3:00:00 AM3/25/97
to

Paolo De Lutiis (gv...@cleveland.Freenet.Edu) wrote:

: Hi.


Paolo,

You need to cast the remote object to the remote interface type, not the
class of the implementation on the server. The remote reference available to
the client implements all the remote interfaces of the real object, but it
cannot be of the same type as the real object on the server.

-- Peter
<peter...@east.sun.com>


0 new messages