• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Attempt to insert null key into a com.webobjects.foundation.NSMutableDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Attempt to insert null key into a com.webobjects.foundation.NSMutableDictionary


  • Subject: Re: Attempt to insert null key into a com.webobjects.foundation.NSMutableDictionary
  • From: Jevon Hills <email@hidden>
  • Date: Wed, 14 May 2003 15:06:02 -0600

Yep  I got the same EC, for both objs.

The full exception follows, hope this helps

[2003-05-14 15:04:53 MDT] <WorkerThread5> java.lang.IllegalArgumentException: Attempt to insert null key into a com.webobjects.foundation.NSMutableDictionary.
at com.webobjects.foundation.NSMutableDictionary.setObjectForKey(NSMutableD ictionary.java:191)
at com.webobjects.eoaccess.EODatabaseContext.recordDatabaseOperation(EOData baseContext.java:4753)
at com.webobjects.eoaccess.EODatabaseContext.databaseOperationForIntermedia teRowFromSourceObject(EODatabaseContext.java:4866)
at com.webobjects.eoaccess.EODatabaseContext.recordDeleteForIntermediateRow FromSourceObjectRelationshipDestinationObject(EODatabaseContext.java:488 2)
at com.webobjects.eoaccess.EODatabaseContext.nullifyAttributesInRelationshi pSourceObjectDestinationObject(EODatabaseContext.java:4933)
at com.webobjects.eoaccess.EODatabaseContext.nullifyAttributesInRelationshi pSourceObjectDestinationObjects(EODatabaseContext.java:4960)
at com.webobjects.eoaccess.EODatabaseContext.recordChangesInEditingContext( EODatabaseContext.java:5931)
at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingCo ntext(EOObjectStoreCoordinator.java:393)
at com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.j ava:2498)
at ConsoleView1.commitChanges(ConsoleView1.java:177)
at ConsoleView1.editContents(ConsoleView1.java:81)
at java.lang.reflect.Method.invoke(Native Method)
at KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAcces sor.java:24)
at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject( NSKeyValueCoding.java:1122)
at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueFo rKey(NSKeyValueCoding.java:1223)
at com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1465)
at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValu eCoding.java:448)
at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementatio n.valueForKeyPath(NSKeyValueCodingAdditions.java:170)
at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:15 31)
at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent (WOKeyValueAssociation.java:46)
at com.webobjects.appserver._private.WOHyperlink.invokeAction(WOHyperlink.j ava:78)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WO DynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicG roup.java:110)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:877)
at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1020)
at com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:1 198)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit hPreparedPage(WOComponentRequestHandler.java:198)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit hPreparedSession(WOComponentRequestHandler.java:279)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit hPreparedApplication(WOComponentRequestHandler.java:314)
at com.webobjects.appserver._private.WOComponentRequestHandler._handleReque st(WOComponentRequestHandler.java:346)
at com.webobjects.appserver._private.WOComponentRequestHandler.handleReques t(WOComponentRequestHandler.java:414)
at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.jav a:1133)
at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread. java:158)
at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java :231)
at java.lang.Thread.run(Thread.java:491)



On Wednesday, May 14, 2003, at 02:51 PM, Jonathan Rochkind wrote:

You can use whatever EC you want, you just need to make sure that when you execute a line that involves two EOs, they are both in the same EC. For instance:

collectionDesc.removeObjectFromBothSidesOfRelationshipWithKey(tempCont ,"
collections_content");


collectionDesc and tempCont better both be in the same EC. You can look at collectionDesc.editingContext() and tempCont.editingContext() to see.

--Jonathan

At 02:36 PM 5/14/2003 -0600, you wrote:
Thanx for your help.

I'm only using one model and I will try to use the
session.defaultEditingcontext. and see if that works for me.

Jevon
On Wednesday, May 14, 2003, at 02:25  PM, Jonathan Rochkind wrote:

Posting the entire stack trace from the error might help some of us
guess what it is.

But here are two guesses:

1) Flattened relationships, in my experience, do not work accross
models. Are both the entities involved in the same model, or are they
in different models?  In my experience, if they are in different
models, it won't work, you can't used the flattened relationship
feature. (Although if the connection dictionaries for both models are
EXACTLY the same, it MIGHT work).

2) Be careful about editing contexts. You can't make relationships
from an object in one EC to an object in another. If you are only
using the standard session default EC, this isn't an issue, but if you
are dealing with multiple ECs, it could be. Be careful, make sure you
fault an EO into the proper EC before putting it in relation to
another EC (or trying to remove it from relation with another EC,
potentially!).


--Jonathan

At 01:57 PM 5/14/2003 -0600, Jevon Hills wrote:
I'm having some problems and the only Info I get is Attempt to insert
null key into a com.webobjects.foundation.NSMutableDictionary.


I have looked at a the other articles/ pages I could find, but I am
still unable to determine why I get this error.


I have a flattened relationship between CollectionDescription and
Content.
I am attempting to remove elements from this relationship by selecting
a Content obj from a list, finding which CollectionDescription it is
in
and then using the following


collectionDesc.removeObjectFromBothSidesOfRelationshipWithKey(tempCo nt ,"
collections_content");



This appears to work, but when I call aCollection.editingContext().saveChanges();

I get the above error.

I have an editing context to use, and as far as I know both my objects
are != null


I have checked the EOModel, but cant see anything wrong with it.

Any suggestions

Jevon K. Hills
Developer - Zymeta Media Promotion Systems
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

Jevon K. Hills
Developer - Zymeta Media Promotion Systems


Jevon K. Hills
Developer - Zymeta Media Promotion Systems
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Attempt to insert null key into a com.webobjects.foundation.NSMutableDictionary
      • From: Jonathan Rochkind <email@hidden>
  • Prev by Date: Space in command line arg, Windows PB
  • Next by Date: Re: Space in command line arg, Windows PB
  • Previous by thread: Re: Attempt to insert null key into a com.webobjects.foundation.NSMutableDictionary
  • Next by thread: Re: Attempt to insert null key into a com.webobjects.foundation.NSMutableDictionary
  • Index(es):
    • Date
    • Thread