You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Reda Benzair <re...@smartjog.com> on 2004/02/13 18:29:03 UTC

random crashes in OJB RC5 ClassCastException for addThisListenerTo

I am experimenting random crashes in OJB RC5 : 

ClassCastException in 
QueryReferenceBroker$PBCollectionProxyListener.addThisListenerTo(CollectionProxy ) 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*/
        }

It seems to work OK since it applied this modification. Do you have a
better solution? Does this change entail hidden drawbacks? Why is this
method called on a non CollectionProxy Object? Is another bug the source
of it?
We user OJB in our Production environment and are pretty satisfied with
it (except maybe when it comes to this bug or to M:N relation with
attributes...  )
thinks All for your response !!!


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org