Hi All,
Im getting a strange error where WO claims to not know what the entity for an object is.
Here's the code :
EOEditingContext ec = new EOEditingContext(); AuditLog newLog = (AuditLog) EOUtilities.createAndInsertInstance(ec,"AuditLog"); newLog.setPerson((Person)EOUtilities.localInstanceOfObject(ec,((Session)session()).currentPerson())); newLog.setEntityName("TestEntity"); newLog.setIpAddress(((Session)session()).getIPAddress(context().request())); newLog.setAttributeName("TestAttribute"); newLog.setNewValue("NewValue"); newLog.setOldValue("OldValue"); ec.saveChanges();
Here's the error :
Error: java.lang.IllegalStateException: Unable to find entity for object {values = {attributeName = "TestAttribute"; newValue = "NewValue"; person = ""; message = ; when = 2006-06-29 07:01:34 Etc/GMT; ipAddress = "130.130.72.73"; entityName = "TestEntity"; oldValue = "OldValue"; }; this = ">"; } Reason: Unable to find entity for object {values = {attributeName = "TestAttribute"; newValue = "NewValue"; person = "<Researcher 36083b (com.webobjects.eoaccess.EOAccessFaultHandler _EOIntegralKeyGlobalID[Researcher (java.math.BigDecimal)1541])>"; message = <com.webobjects.foundation.NSKeyValueCoding$Null>; when = 2006-06-29 07:01:34 Etc/GMT; ipAddress = "130.130.72.73"; entityName = "TestEntity"; oldValue = "OldValue"; }; this = "<AuditLog f4b610 <EOTemporaryGlobalID: 0 0 -126 -126 72 73 0 0 -49 100 1 0 0 0 1 12 30 -105 -72 30 25 96 -16 -12>>"; } Stack trace: File | Line# | Method | Package |
| EODatabaseContext.java | 4624 | _entityForObject | com.webobjects.eoaccess | EODatabaseContext.java | 4528 | _buildPrimaryKeyGeneratorListForEditingContext | com.webobjects.eoaccess | EODatabaseContext.java | 5843 | prepareForSaveWithCoordinator | com.webobjects.eoaccess | EOObjectStoreCoordinator.java | 409 | saveChangesInEditingContext | com.webobjects.eocontrol | EOEditingContext.java | 3226 | saveChanges | com.webobjects.eocontrol | attributesManagement.java | 51 | | attributesManagement | NativeConstructorAccessorImpl.java | NA | newInstance0 | sun.reflect | NativeConstructorAccessorImpl.java | 39 | | sun.reflect | DelegatingConstructorAccessorImpl.java | 27 | | sun.reflect | Constructor.java | 274 | newInstance | java.lang.reflect |
AuditLog is an entity in the model file ( both are part of a framework ). AuditLog extends EOGenericRecord.
Any ideas on why this is happening and how to fix it ?
OS X 10.4.7 WO 5.3 xCode 2.3
Owen McKerrow WebMaster, emlab Ph : +61 02 4221 5517
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "As of tomorrow, employees will only be able to access the building using individual security cards. Pictures will be taken next Wednesday employees will receive their cards in two weeks." - "Dilbert Quotes" Winner, Fred Dales, Microsoft Corp
|