What code is trying to cast it? Are you casting the result to "tutor.ojb.testproxy.Actor" or an interface that this class implements?
The reference should be to the Actor class, but when you retrieve the object, you cannot cast it to Actor, as it will be a proxy of actor, which implements the same interface as Actor. Daniel. > -----Original Message----- > From: Grzegorz Pypec [mailto:[EMAIL PROTECTED] > Sent: 22 December 2004 00:29 > To: [EMAIL PROTECTED] > Subject: Using proxies with ODMG. > > > Hi > > I have the object "film" which contains a collection of Actor > objects (1:n > relacion). > Actor class implements the InterfaceActor. The descriptor of > class Actor looks > like that: > <class-descriptor > class="tutor.ojb.testproxy.Actor" > proxy="dynamic" > table="Actor" > > > > When I try to retrieve object film (with actors) the following > error occur: > <error> > Exception in thread "main" java.lang.ClassCastException: $Proxy0 > at tutor.ojb.testproxy.Film.getAktor(Unknown Source) > at tutor.ojb.testproxy.ProxyTut.findFilm_ODMG(Unknown Source) > at tutor.ojb.testproxy.ProxyTut.main(Unknown Source) > Java Result: 1 > </error> > > So, what should I using the proxies in this simple situation above ?? > > regards > -- > | Grzegorz Pypec < greg (at) xtr (dot) net (dot) pl > > | GG# 3744625 > | > | GPG: 21233D71C5C2BD765CF5A69648B26B957FF6CFFE > -- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
