java.lang.ClassCastException
Sunil Goyal <[email protected]>
| Newsgroups | gmane.comp.java.ozone.user |
|---|---|
| Organization | Salzburg Research |
| Message-ID | <[email protected]> |
Hello all,
I am having a trouble when using protected methods for updating objects.
and get a class cast exception.
interface A extends OzoneRemote{
}
class AImpl extends OzoneObject implements A{
protected void add(B b){
// any implementation
}
}
interface B extends OzoneRemote{
public void somemethod(A a);
}
class BImpl extends OzoneObject implements A{
public void somemethod(A a){
((AImpl)a).add((B)self());
}
}
When I call the method somemethod() in a test class, I get
a class cast exception. The class cast exception, I think is because
I am trying to cast the object into AImpl whereas it actually is
instance of AImpl_Proxy .
But as the method is protected, I can't cast this
into "A" .
What is the solution for this?
Thanks
Regards
Sunil
--
=====================================================================
Sunil Goyal
New Media Lab
Salzburg Research Forschungsgesellschft m.b.H.
Jakob Haringer-Strasse 5/III | A-5020 Salzburg
T: +43.662.2288-414 | F: +43.662.2288-222
[email protected]
http://www.salzburgresearch.at
======================================================================
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click