Hi Owen,

On Jun 29, 2006, at 12:09 AM, Owen McKerrow wrote:

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 = ">"; }

The this = ">"; looks spectacularly weird. Was that a cut and paste problem?

What this message usually means is that the entity / model did not get loaded. This can be the result of:

1. App referencing code in the framework from someplace other than the .framework 2. EOModel not getting built into the framework (e.g. a project config or build problem) 3. Corrupt .eomodeld directory, index.emodel, or entity.plist file. Check that EOModeler can open the model in the .framework that your app is referencing.

Chuck


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
<init>
attributesManagement
NativeConstructorAccessorImpl.java
NA
newInstance0
sun.reflect
NativeConstructorAccessorImpl.java
39
newInstance
sun.reflect
DelegatingConstructorAccessorImpl.java
27
newInstance
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
http://emlab.uow.edu.au

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "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






 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill% 40global-village.net

This email sent to [EMAIL PROTECTED]

--
Coming sometime... - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro

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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to