Following is the StackTrace ::
<er.ajax.AjaxRequestHandler>: Exception occurred while handling request:
java.lang.NullPointerException
<WorkerThread11> java.lang.NullPointerException
at com.webobjects.eoaccess.EODatabaseContext.primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java:4845)
at com.webobjects.eoaccess.EODatabaseContext.databaseOperationForIntermediateRowFromSourceObject(EODatabaseContext.java:4863)
at com.webobjects.eoaccess.EODatabaseContext.recordInsertForIntermediateRowFromSourceObject(EODatabaseContext.java:4888)
at com.webobjects.eoaccess.EODatabaseContext.relayAttributesInRelationshipSourceObjectDestinationObject(EODatabaseContext.java:4913)
at com.webobjects.eoaccess.EODatabaseContext.relayAttributesInRelationshipSourceObjectDestinationObjects(EODatabaseContext.java:4966)
at com.webobjects.eoaccess.EODatabaseContext.recordChangesInEditingContext(EODatabaseContext.java:6036)
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:981)
at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:903)
at Test.testMethod(Test.java:89)
* same code is working, if both entities are in same EOModel.
Please let me know if there is any other configurations/changes.