Re: Can't insert eos on 5.1 win2k
Jonathan Rochkind <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.eof |
|---|---|
| Message-ID | <[email protected]> |
The error message should also provide you with a stack trace that shows you
exactly which line in your code is triggering the exception. That might or
might not be helpful.
I'm not sure if this is your problem or not, but my general rule of thumb is:
Always insert an EO in an EC immediately after creating it, before doing
anything else with it. [Unless you have some good reason to do it
differently, and you've tested it thoroughly to make sure it works; it
doesn't always].
So I'd suggesting putting the insertObject call immediately after you
instantiate the new DeployLogEO, and before you call the takeValueForKey
(or the willChange(), which may or may not be neccesary anyway, but I'll
trust you that it is here. Can't hurt, in any event).
At 08:02 PM 9/30/2002 +0000, Hordur Thordarson wrote:
>Hi all,
>
>I'm getting the following error when trying to insert an eo in a new wo
>5.1 project on win2k:
>
>com.webobjects.foundation.NSForwardException
>[java.lang.IllegalAccessError] try to access field
>com.webobjects.eocontrol.EOSharedEditingContext._sharedLock from class
>com.webobjects.eoaccess._EOGlobalObjectStoreLock
>
>The code that causes the error is:
>
>public WOActionResults defaultAction() {
>
> DeployLogEO logRec;
> NSTimestamp curDate = new NSTimestamp();
>
> try {
> logRec = new DeployLogEO();
> logRec.willChange();
> logRec.takeValueForKey(curDate, "logdatetime");
> this.session().defaultEditingContext().insertObject(logRec);
> this.session().defaultEditingContext().saveChanges();
> }
> catch (Exception e) {
> System.out.println(e.toString());
> }
>}
>
>I just put this into a new project with a new eomodel and everything (was
>happening in a project converted from 4.5 to 5.1) but no luck. Is my
>installation messed up or smth ? There are 2 other reports of this bug on
>the wodev list but neither seems to have been answered (last one was today
>or yesterday).
>
>All hints and suggestions appreciated.
>
>Thanks,
>
>Hordur Thordarson
>Smartkort hf.
>
>_______________________________________________
>EOF mailing list
>[email protected]
>http://www.omnigroup.com/mailman/listinfo/eof