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

Abdullah Odeh Al-Zaghameem <[email protected]> Sat, 22 Nov 2008 09:24:41 -0700
Newsgroups gmane.comp.java.sun.rmi
Message-ID <LISTSERV%[email protected]>
Hi all, and thanks for your interaction.
WOW .. the previous one was sent by mistake.

>> Or it was loaded by different classloaders because a context ClassLoad=
er
>> loaded the class which was downloaded and the app classloader loaded t=
he
>> class which it is being cast with.

I use JMangler to load the Original class instances, and (after checking)=
 the=20
remote proxies loaded by the sun.rmi.server.LoaderHandler.Loader.

So, they have to be different class loaders. The big question is, what's =
the=20
releation between class loaders and the internal this$0 field? please ref=
er back=20
to the original post to see the Exception description.

>You should print out the getClassLoader() value for both the object and =
the=20
cast
>class to see that they are being resolved where you want them to be.=20=20=


I did, and I try to set the current thread context class loader as follow=
:

 Thread.currentThread().setContextClassLoader(remoteObj.getClass
().getClassLoader());

also try:

 Thread.currentThread().setContextClassLoader(localObj.getClass
().getClassLoader());

but got the same result.

I think the problem comes from attempting to pass an instance object=20
(serializable by th way:)) of an internal class as a parameter in the rem=
ote=20
instance method, and hence, the Exception!!

Thanx, Abdullah

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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