Re: RMI-USERS Digest - 6 Nov 2008 to 18 Nov 2008 (#2008-39)

Gregg Wonderly <[email protected]> Thu, 20 Nov 2008 17:35:42 -0600
Newsgroups gmane.comp.java.sun.rmi
Message-ID <[email protected]>
Esmond Pitt FACS wrote:
> 1. RE: ClassCastException with inner-class application
> 
>> java.lang.ClassCastException: cannot assign instance of $Proxy2 to field
> 
> There are two causes for that.
> 
> (1) the interface implemented by the remote object doesn't extend Remote
> (2) the interface implemented by the remote object isn't the same as the
> interface
> expected by the client, i.e. you have copied the interface into another
> package.

Or it was loaded by different classloaders because a context ClassLoader loaded 
the class which was downloaded and the app classloader loaded the class which it 
is being cast with.

Gregg Wonderly

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html