Re: EC subclass constructor trouble

Zak Burke <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Gary Teter wrote on 3/29/06 2:44 PM:
> Is it possible that the user is temporary (hasn't been saved yet)? You 
> can't localize a fault for an object with a temporary globalID into 
> another ec.

Gary, Sacha,

This was the problem, though I'm not sure how the application got into 
this state. It looks like a user triggered a component action for a 
session that had timed out, but that normally returns the 
session-timeout page. Weird. I have a bit more sleuthing to do, but I am 
on my way now.

A more technically accurate version of my first message is that, "I get 
an NPE that is _triggered_ by the last line of the constructor..." The 
actual NPE is buried inside EOEditingContext, where it becomes clear 
that the problem is in trying to fire a fault for an unsaved EO:

java.lang.NullPointerException
at ...EOEditingContext.lockObjectStore(EOEditingContext.java:4675)
at ...EOEditingContext.faultForGlobalID(EOEditingContext.java:3607)
at ...EOUtilities.localInstanceOfObject(EOUtilities.java:940)
at ...I3pkbEditingContext.<init>(I3pkbEditingContext.java:99)

Thanks for the help,

zak.


> On Mar 29, 2006, at 11:28 AM, Zak Burke wrote:
> 
>> I have an EC class that extends EOEditingContext. Occasionally, when 
>> creating a child EC of an existing EC, I get a NPE on the last line of 
>> the constructor (see below). Any idea how that is possible? I'm at a 
>> loss.
>>
>> init() is not a likely culprit; all it does is a single call to 
>> super.setMessageHandler().
>>
>> zak.
>>
>>
>> public I3pkbEditingContext(Session s, EOEditingContext ec)
>> {
>>     super(ec);
>>     init();
>>     User u = s.user();
>>     if (u != null)
>>         this.user = (User) EOUtilities.localInstanceOfObject(this, u);
>> }
> 
> --WireHose: Smart metadata and personalization for WebObjects.
> http://www.wirehose.com/
> 
> _______________________________________________
> WebObjects-dev mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/webobjects-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.