ClassCastException with inner-class application
Abdullah Odeh Al-Zaghameem <[email protected]> Tue, 18 Nov 2008 08:01:03 -0700
| Newsgroups | gmane.comp.java.sun.rmi |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
Hi all, I'm developing a new distributed model (T-side and B-side) that is using = inner- classes at T-side. When I try to invoke a method of B-side remote instanc= e=20 (say b.method(innerClassInstance))from within inner-class of T-side, I g= ot=20 the following Exception: -------------------------------------------------------------------- java.lang.reflect.InvocationTargetException =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown=20 Source) =09at java.lang.reflect.Method.invoke(Unknown Source) ... etc Caused By: java.lang.ClassCastException: cannot assign instance of $Proxy2 to field= =20 allInOnePkg.ChangeTheDecore$_DT__innerInterface.this$0 of type=20 allInOnePkg.ChangeTheDecore in instance of=20 allInOnePkg.ChangeTheDecore$_DT__innerInterface =09at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues (Unknown Source) =09at java.io.ObjectStreamClass.setObjFieldValues(Unknown Source) ... 39 more!! -------------------------------------------------------------------- Where: _DT__innerInterface is the inner class that implements the interface=20 innerInterface. Any suggestions in this regard are highly appreciated. Thanks in advance. =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