Hi, i am also having the same problem with rc5.
-----Original Message----- From: Reda Benzair [mailto:[EMAIL PROTECTED] Sent: terēa-feira, 17 de Fevereiro de 2004 15:06 To: OJB Users List Subject: Re: proxy loading issue from rc4 -> rc5 hi Frank I have the same problem but this bug is not fix !! this is my last mail I am experimenting random crashes in OJB RC5 : ClassCastException in QueryReferenceBroker$PBCollectionProxyListener.addThisListenerTo(CollectionP roxy ) trying to cast into CollectionProxy: protected void addThisListenerTo(Object listenedObject) { + /*MODIFICATION AWAITING OJB'sTEAM REAL CORRECTION*/ + if(listenedObject==null || !(listenedObject instanceof CollectionProxy)) + { + log.warn("The listenedObject is no CollectionProxy. Cannot get registered! " + listenedObject); + } + else + { _listenedCollection = (CollectionProxy) listenedObject; _listenedCollection.addListener(this); + } + /*END MODIFICATION AWAITING OJB'sTEAM REAL CORRECTION*/ } but this modif generate others error ! >Hi, > >I think there's a wrong behaivour in 1.0 rc5. >(with 1.0 rc4 it works well) > >I have an Object with holds a collection of other objects >the loading of the collection is realized wih "proxy=true" >The Class Descriptor is correct (it works with 1.0 rc4) > >public class SecondObject >{ > int pkey; > ..... >} > >public class FirstObject >{ > int pkey; .... > Collection manySecondObjects; >} > >If I do the following: > ><code> >Collection firstObjects = firstObjectPeer.getAll(); > >// .. get 1 Object from Collection (Iterator code missing, only for >understanding) >FirstObject firstObject = (FirstObject)firstObjects.next(); > >Iterator i = firstObject .getManySecondObjects().iterator(); //here >comes the Exception with 1.0 rc5 > >//do anything with every second Object >//... ></code> > >If I try to get the Iterator for "ManySecondObjects" >it works well with 1.0 rc4 >but with 1.0 rc5 it throws an exception (see below) >It seems to be, that the proxy dynamic loads works not in any case > >but if i catch it and ask again for the Iterator ><code> >Iterator i = firstObject .getManySecondObjects().iterator(); ></code> > >it works >It looks like: >Trying once to load the collections throws the exception >but also sets a setting in the right way, so the second try works. > >but if I load again the firstObject, it does not work, >at the first time trying to access the collection, only at the second >time (and all following tries) > >Maybe I am doing sth. wrong or >maybe someone could confirm this behaivour. > >Exception with 1.0 rc5 org.apache.ojb.broker.PersistenceBrokerException >java.lang.ClassCastException > at >org.apache.ojb.broker.core.QueryReferenceBroker$PBCollectionProxyListener.a d >dThisListenerTo(Unknown Source) > at >org.apache.ojb.broker.core.QueryReferenceBroker$PBPrefetchingListener.prefe t >ch(Unknown Source) > at >org.apache.ojb.broker.core.QueryReferenceBroker$PBCollectionProxyListener.b e >foreLoading(Unknown Source) > at >org.apache.ojb.broker.accesslayer.CollectionProxy.beforeLoading(Unknown >Source) > at >org.apache.ojb.broker.accesslayer.CollectionProxy.loadData(Unknown Source) > at org.apache.ojb.broker.accesslayer.ListProxy.loadData(Unknown >Source) > at org.apache.ojb.broker.accesslayer.CollectionProxy.getData(Unknown >Source) > at >org.apache.ojb.broker.accesslayer.CollectionProxy.iterator(Unknown Source) > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > -- *Reda BENZAIR** *Software Analyst *** *Phone: +33 (0)1 4996 6324 Fax: +33 (0)1 4996 6405 Mobile: +33 (0)6 6240 6192 [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> --------------------------------------------------------------------- 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]