Re: Unable to find entity for object
Re: Unable to find entity for object
- Subject: Re: Unable to find entity for object
- From: Chuck Hill <email@hidden>
- Date: Thu, 29 Jun 2006 09:57:16 -0700
On Jun 29, 2006, at 9:51 AM, David Aspinall wrote:
This line also looks wrong to me. Why are you trying to change the
Entity Name?
newLog.setEntityName("TestEntity");
OUCH! I skipped right over that. EOF uses entityName. Treat it
like a reserved word and stay far away from it. You are going to
hose EOF doing this.
Chuck
Is this an attribute on your table? It overrides the default
EOEnterpriseObject method 'entityName' which I think EOF will be
needing.
I would recommend removing this column/attribute and trying again.
I would also change the attributeName while your at it. Maybe
'ObjectName' and 'ColumnName' would be better?
David
---
Ticoon Technology Inc.
56 The Esplanade, Suite 404, Toronto, ON, M5E 1A7
On 29-Jun-06, at 12:43 PM, Chuck Hill wrote:
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@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
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@hidden)
Help/Unsubscribe/Update your Subscription:
40ticoon.com
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:
40global-village.net
This email sent to email@hidden
--
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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden