Re: Rép : Re: ec.SaveChanges and relationship
Re: Rép : Re: ec.SaveChanges and relationship
- Subject: Re: Rép : Re: ec.SaveChanges and relationship
- From: Chuck Hill <email@hidden>
- Date: Tue, 18 Jun 2013 09:05:51 -0700
Are they in the same database? If so, the connection information for the two models must be absolutely identical.
Chuck
On 2013-06-18, at 8:01 AM, Raymond NANEON wrote:
> Oupppsss, I forgot something, EOIndividuUlr and EOPersonnel are in differents models.
> Envoyé depuis iCloud
>
> Le 18 jun 2013 à 07:59, Raymond NANEON <email@hidden> a écrit :
>
>> Here is the complete stacktrace :
>>
>> juin 18 16:56:00 PreProjets[8484] INFO er.transaction.adaptor.Exceptions - Database Exception occured: java.lang.NullPointerException
>> java.lang.NullPointerException
>> at com.webobjects.eoaccess.EODatabaseContext._objectFaultWithSnapshotRelationshipEditingContext(EODatabaseContext.java:2356)
>> at com.webobjects.eoaccess.EODatabaseContext._fireDeferredFaultWithSourceObject(EODatabaseContext.java:2401)
>> at com.webobjects.eoaccess.EOAccessDeferredFaultHandler.createFaultForDeferredFault(EOAccessDeferredFaultHandler.java:49)
>> at com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:1279)
>> at er.extensions.eof.ERXGenericRecord.willReadRelationship(ERXGenericRecord.java:378)
>> at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:614)
>> at er.extensions.eof.ERXGenericRecord$TouchingBinding.valueInObject(ERXGenericRecord.java:207)
>> at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634)
>> at com.webobjects.eoaccess.EODatabaseContext.databaseOperationForObject(EODatabaseContext.java:4814)
>> at com.webobjects.eoaccess.EODatabaseContext.valuesForKeys(EODatabaseContext.java:6535)
>> at com.webobjects.eocontrol.EOObjectStoreCoordinator.valuesForKeys(EOObjectStoreCoordinator.java:326)
>> at com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:439)
>> at er.extensions.ERXExtensions$KeyValueQualifierSQLGenerationSupport.schemaBasedQualifierWithRootEntity(ERXExtensions.java:357)
>> at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._schemaBasedQualifierWithRootEntity(EOQualifierSQLGeneration.java:179)
>> at com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:227)
>> at com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055)
>> at er.extensions.eof.ERXDatabaseContext._objectsWithFetchSpecificationEditingContext(ERXDatabaseContext.java:68)
>> at com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195)
>> at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488)
>> at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069)
>> at er.extensions.eof.ERXEC.objectsWithFetchSpecification(ERXEC.java:1305)
>> at com.webobjects.eoaccess.EODatabaseContext.objectsForSourceGlobalID(EODatabaseContext.java:4084)
>> at er.extensions.eof.ERXDatabaseContext.objectsForSourceGlobalID(ERXDatabaseContext.java:50)
>> at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsForSourceGlobalID(EOObjectStoreCoordinator.java:634)
>> at com.webobjects.eocontrol.EOEditingContext.objectsForSourceGlobalID(EOEditingContext.java:3923)
>> at er.extensions.eof.ERXEC.objectsForSourceGlobalID(ERXEC.java:1265)
>> at com.webobjects.eoaccess.EODatabaseContext._fireArrayFault(EODatabaseContext.java:4245)
>> at com.webobjects.eoaccess.EOAccessArrayFaultHandler.completeInitializationOfObject(EOAccessArrayFaultHandler.java:77)
>> at com.webobjects.eocontrol._EOCheapCopyMutableArray.willRead(_EOCheapCopyMutableArray.java:39)
>> at com.webobjects.eocontrol._EOCheapCopyMutableArray.count(_EOCheapCopyMutableArray.java:99)
>> at com.webobjects.foundation.NSArray.containsObject(NSArray.java:460)
>> at com.webobjects.eocontrol.EOCustomObject.includeObjectIntoPropertyWithKey(EOCustomObject.java:904)
>> at er.extensions.eof.ERXGenericRecord.includeObjectIntoPropertyWithKey(ERXGenericRecord.java:1223)
>> at utt.rec.projet.server.metier.grhum._EOIndividuUlr.addToPersonnels(_EOIndividuUlr.java:895)
>> 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:597)
>> at com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
>> at com.webobjects.eocontrol.EOCustomObject.addObjectToPropertyWithKey(EOCustomObject.java:940)
>> at com.webobjects.eocontrol.EOCustomObject.addObjectToBothSidesOfRelationshipWithKey(EOCustomObject.java:1055)
>> at er.extensions.eof.ERXGenericRecord.addObjectToBothSidesOfRelationshipWithKey(ERXGenericRecord.java:582)
>> at utt.rec.projet.server.metier.admrec._EOPersonnel.setIndividuRelationship(_EOPersonnel.java:128)
>> at utt.rec.projet.server.components.controler.NextProjectCtrl.ajoutPerson(NextProjectCtrl.java:796)
>> at utt.rec.projet.server.components.controler.NextProjectCtrl.updatePers(NextProjectCtrl.java:672)
>> 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:597)
>> at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKeyValueCoding.java:636)
>> at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134)
>> at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324)
>> at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:449)
>> at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212)
>> at com.webobjects.foundation.NSKeyValueCodingAdditions$Utility.valueForKeyPath(NSKeyValueCodingAdditions.java:151)
>> at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:217)
>> at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1804)
>> at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:50)
>> at er.extensions.components.ERXComponentUtilities.valueForBinding(ERXComponentUtilities.java:539)
>> at er.extensions.components.ERXDynamicElement.valueForBinding(ERXDynamicElement.java:161)
>> at er.ajax.AjaxSubmitButton.handleRequest(AjaxSubmitButton.java:328)
>> at er.ajax.AjaxSubmitButton.invokeAction(AjaxSubmitButton.java:319)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
>> at er.extensions.components._private.ERXWOForm.invokeAction(ERXWOForm.java:218)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
>> at er.ajax.AjaxDynamicElement.invokeAction(AjaxDynamicElement.java:50)
>> at er.ajax.AjaxUpdateContainer.invokeAction(AjaxUpdateContainer.java:82)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
>> at com.webobjects.appserver._private.WOComponentContent.invokeAction(WOComponentContent.java:38)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
>> at com.webobjects.appserver._private.WOConditional.invokeAction(WOConditional.java:86)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
>> at com.webobjects.appserver._private.WOHTMLURLValuedElement.invokeAction(WOHTMLURLValuedElement.java:149)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
>> at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079)
>> at com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105)
>> at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115)
>> at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079)
>> at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1357)
>> at com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:1745)
>> at er.extensions.appserver.ajax.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:119)
>> at er.extensions.appserver.ERXApplication.invokeAction(ERXApplication.java:1988)
>> at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedPage(WOComponentRequestHandler.java:206)
>> at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedSession(WOComponentRequestHandler.java:298)
>> at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedApplication(WOComponentRequestHandler.java:332)
>> at com.webobjects.appserver._private.WOComponentRequestHandler._handleRequest(WOComponentRequestHandler.java:369)
>> at com.webobjects.appserver._private.WOComponentRequestHandler.handleRequest(WOComponentRequestHandler.java:442)
>> at er.ajax.AjaxRequestHandler.handleRequest(AjaxRequestHandler.java:20)
>> at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
>> at er.extensions.appserver.ERXApplication.dispatchRequestImmediately(ERXApplication.java:2109)
>> at er.extensions.appserver.ERXApplication.dispatchRequest(ERXApplication.java:2074)
>> at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
>> at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
>> at java.lang.Thread.run(Thread.java:680)
>> Envoyé depuis iCloud
>>
>> Le 18 jun 2013 à 03:43, Raymond NANEON <email@hidden> a écrit :
>>
>>> Hi Maik,
>>>
>>> I have read and followed all EOF Commandements but I can't fix the issue.
>>> an idea?
>>>
>>> thanks
>>> Envoyé depuis iCloud
>>>
>>> Le 18 jun 2013 à 02:43, Musall Maik <email@hidden> a écrit :
>>>
>>>> Hi Raymond,
>>>>
>>>> I have come across those as well some time ago, and it turned out that I didn't strictly obey all the EOF commandments back then.
>>>>
>>>> http://wiki.wocommunity.org/display/documentation/EOF-Using+EOF-The+EOF+Commandments
>>>>
>>>>
>>>> If you don't follow those, EOF will fight back with all sorts of strange effects, like those NullPointerExceptions, or missing snapshot exceptions and the like. So I suggest you doublecheck those thoroughly.
>>>>
>>>> Maik
>>>>
>>>>
>>>>
>>>> Am 18.06.2013 um 09:44 schrieb Raymond NANEON <email@hidden>:
>>>>
>>>>> Hi List,
>>>>>
>>>>> I have a big problem to save my data. When I set the relastionship entity1.setEntity2Relationship(entity2), I get a java NullPointerException at the method who set the relation :
>>>>>
>>>>> addObjectToBothSidesOfRelationshipWithKey(entity2, _Enity1.ENTITY2_KEY); <-----
>>>>>
>>>>> When I try another way entity1.setEntity2(enity2) I get the same java NullPointerException when I want to save entity1.
>>>>>
>>>>> juin 18 09:34:38 PreProjets[8484] ERROR er.extensions.appserver.ERXApplication -
>>>>> NullPointerException
>>>>> at com.webobjects.eoaccess.EODatabaseContext._objectFaultWithSnapshotRelationshipEditingContext(EODatabaseContext.java:2356)
>>>>> ... skipped 1 stack elements
>>>>> at com.webobjects.eoaccess.EOAccessDeferredFaultHandler.createFaultForDeferredFault(EOAccessDeferredFaultHandler.java:49)
>>>>> at com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:1279)
>>>>> at er.extensions.eof.ERXGenericRecord.willReadRelationship(ERXGenericRecord.java:378)
>>>>> at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:614)
>>>>> at er.extensions.eof.ERXGenericRecord$TouchingBinding.valueInObject(ERXGenericRecord.java:207)
>>>>> at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634)
>>>>> ... skipped 2 stack elements
>>>>> at com.webobjects.eocontrol.EOObjectStoreCoordinator.valuesForKeys(EOObjectStoreCoordinator.java:326)
>>>>> ... skipped 4 stack elements
>>>>> at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(EOObjectStoreCoordinator.java:373)
>>>>> at com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)
>>>>> at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:1176)
>>>>> at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:1099)
>>>>>
>>>>> Thanks for your help.
>>>>> Envoyé depuis iCloud
>>>>> _______________________________________________
>>>>> 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
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>> _______________________________________________
>>> 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
>>>
> _______________________________________________
> 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
--
Chuck Hill
Executive Managing Partner, VP Development and Technical Services
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/gvc/practical_webobjects
Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C!
Global Village Consulting ranks 44th in 25th annual PROFIT 500 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
_______________________________________________
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