Re: excludeObjectFromPropertyWithKey weird error
Re: excludeObjectFromPropertyWithKey weird error
- Subject: Re: excludeObjectFromPropertyWithKey weird error
- From: Chuck Hill <email@hidden>
- Date: Wed, 1 Aug 2007 10:25:06 -0700
On Jul 31, 2007, at 6:51 PM, Lachlan Deck wrote:
On 31/07/2007, at 2:42 AM, Chuck Hill wrote:
On Jul 29, 2007, at 8:35 PM, Lachlan Deck wrote:
On 28/07/2007, at 1:04 AM, Chuck Hill wrote:
No. Has your model changed and the Java not been regenerated?
Good suggestion.... double checking...
The only other thing I can think of is a bad call to
takeValueForKey on this EO that is overwriting sessions() with
something else. Try overriding setSessions to log a stack trace
if the value is not instanceof NSArray.
The issue seems to be the current value of sessions() rather than
the value being taken. i.e., null is neither an instance of
either NSArray or NSMutableArray...
Are you sure it is null? If it is null, you may have forgotten to
call super in awakeFromInsertion or awakeFromFetch. Or see my
guess further down.
This particular problem did seem to be rectified with a clean build...
Actually I'm now seeing a number of these errors... what's the
usual cause for 'no database snapshot available'?
You mucking with EOF's head. :-) Or perhaps a reference counting
bug in EOF, but I rater doubt that in 2007.
Wish I could get inside EOF's head... that'd make it easier to mess
with ;-) But maybe this is an inheritance thing or some locking
thing...
I've seen it at other times also.
java.lang.IllegalStateException: There is no database snapshot
available for the object {values = {<....>; entityType =
"CourseClass"; this =
"<ish.willowservices.soap.eoaccess.CourseClass 1117cc0
_EOIntegralKeyGlobalID[CourseClass (java.lang.Long)928]>"; } with
GlobalID _EOIntegralKeyGlobalID[CourseClass (java.lang.Long)928]
Here it is complaining that it can't find a CourseClass...
Yep.
at
com.webobjects.eoaccess.EODatabaseContext.objectsForSourceGlobalID
(EODatabaseContext.java:4205)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsForSourceGl
obalID(EOObjectStoreCoordinator.java:682)
at
com.webobjects.eocontrol.EOEditingContext.objectsForSourceGlobalID
(EOEditingContext.java:3904)
at
com.webobjects.eocontrol.EOEditingContext.objectsForSourceGlobalID
(EOEditingContext.java:3904)
at
com.webobjects.eoaccess.EODatabaseContext._fireArrayFault
(EODatabaseContext.java:4418)
at
com.webobjects.eoaccess.EOAccessArrayFaultHandler.completeInitializa
tionOfObject(EOAccessArrayFaultHandler.java:70)
at
com.webobjects.eocontrol._EOCheapCopyMutableArray.willRead
(_EOCheapCopyMutableArray.java:38)
at com.webobjects.eocontrol._EOCheapCopyMutableArray.count
(_EOCheapCopyMutableArray.java:92)
at com.webobjects.foundation.NSArray.containsObject
(NSArray.java:601)
at
com.ish.webobjects.eocontrol.ISHGenericRecord.excludeObjectFromPrope
rtyWithKey(ISHGenericRecord.java:75)
at
com.ish.willow.eoaccess.model._CourseClass.removeFromSessions
(_CourseClass.java:560)
And here it seems to be firing an array fault of
courseClass.sessions. Is sessions() an array of CourseClass?
No. Related to.
So it is looking more like EOF is confused about which entity this is.
at
com.webobjects.eocontrol.EOCustomObject.addObjectToBothSidesOfRelati
onshipWithKey(EOCustomObject.java:1066)
The other possibility that I'll need to check out is whether this
is another /feature/ of vertical inheritance (as its reverse
relationship is mandatory from the sub-entity).
Looking at this, my suspicion is that you have messed up the
restricting qualifiers on the entities (or something)
Restricting qualifiers checked and looks correct. Super entity's
awakeFromInsertion:
public void awakeFromInsertion( EOEditingContext ec ) {
super.awakeFromInsertion( ec );
setEntityType( entityName() );
}
I'm reasonably certain that I'm locking/unlocking correctly also.
What about in the database? Any manual manipulation happen there
that might be confusing EOF?
and EOF is getting confused about which class an entity is for.
That also ties into the error below. If you call sessions() on an
CourseClass object that EOF thinks is some other Entity, it
probably did not put a value for sessions in its dictionary, thus
it would be null. Try printing out the entityName() when sessions
() == null and see what EOF says. Also log out the global ID.
Thanks, if I see that again I'll try that.
And yes, it could be something related to vertical inheritance. I
hope your use of VI is mandated by a legacy schema. Otherwise you
are causing yourself all sort of pain.
Yes, pain noted. Pain previously felt as list archives can show...
but schema/features made vi the logical choice at the time. HI was
not possible, ST would have been difficult... anyway. What's done
is done.
:-)
Chuck
On Jul 27, 2007, at 12:43 AM, Lachlan Deck wrote:
anyone seen something similar to the below before?
java.lang.IllegalArgumentException:
removeObjectToPropertyWithKey: the key sessions is not a Array
or one of its subclasses - unable to remove the value.
at
com.webobjects.eocontrol.EOCustomObject.excludeObjectFromPropertyW
ithKey(EOCustomObject.java:987)
at
com.ish.willow.eoaccess.model._CourseClass.removeFromSessions
(_CourseClass.java:560)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.webobjects.foundation.NSSelector._safeInvokeMethod
(NSSelector.java:120)
at
com.webobjects.eocontrol.EOCustomObject.removeObjectFromPropertyWi
thKey(EOCustomObject.java:1011)
at
com.webobjects.eocontrol.EOCustomObject.addObjectToBothSidesOfRela
tionshipWithKey(EOCustomObject.java:1066)
with regards,
--
Lachlan Deck
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden