Re: NullPointerException in _popComponentFromContext
Re: NullPointerException in _popComponentFromContext
- Subject: Re: NullPointerException in _popComponentFromContext
- From: "Ricardo J. Parada" <email@hidden>
- Date: Fri, 26 Jun 2009 08:59:16 -0400
On Jun 26, 2009, at 12:55 AM, Chuck Hill wrote:
On Jun 25, 2009, at 8:49 PM, Ricardo J. Parada wrote:
Let me correct something I said: the action method is getting
called!!! –– I was just confused the first time I looked.
Anyways, the action method gets called and then that action method
is calling performParentAction as follows:
return performParentAction(s);
I did not write that component and I rarely use the
performParentAction. But that is returning null. And that is the
value my component gets at line#113 and returns the page instead
(is that bad? should I return the null value instead?).
Returning context.page is best.
Thanks... it's good to know.
Then if I resume execution I get the null pointer exception in
_popComponentFromContext() in WebObjects.
Any chance the code called by performParentAction(s); is doing
something bad?
I just noticed that the context().component() right before calling
performParentAction(s) is my component that triggered the action. BUT
then, after I call performParentAction(s) I check the
context().component() again and I noticed it has changed. Shouldn't
it be the same? Anyways, I'm suspecting that's my problem. Because
if I call context()._setCurrentComponent() to set the current
component back to the one before calling performParentAction(s) then
the exception no longer happens.
Anyways, this is good progress... If the context current component was
not supposed to change then I need to find out why it's changing.
That may require a subclass of the editing context (which Wonder may
already have) and then implement the _setCurrentComponent() and set a
breakpoint so that I can see what's changing it.
Chuck
Still investigating...
On Jun 25, 2009, at 10:59 PM, Ricardo J. Parada wrote:
Well here's what I'm seeing... my component determines that it is
the one that should invoke the action and goes through this code:
// Tell context that an action was performed. If this is
// not done, the form's default action will be called also.
111: wocontext.setActionInvoked(true);
112:
113: WOActionResults obj = (WOActionResults)
valueForBinding(ACTION_BINDING_KEY);
114: if (obj == null) obj = wocontext.page();
115:
116: return obj;
Line # 113 should be calling the action method that is bound to
the action binding. That is the method on which I set the
breakpoint that I was referring to earlier. The one I never hit.
So if I don't hit the breakpoint then it's not calling it. But it
is calling something else because I see stuff show on the console
every time I evaluate the expression
valueForBinding(ACTION_BINDING_KEY).
Anyways, I'll try to investigate what is getting called... or
maybe take a look at valueForBinding to find out why it's not
calling the right thing.
If I evaluate the expression
_associationWithName(ACTION_BINDING_KEY) in the debugger right
after line #113 I get the following:
(ognl.helperfunction.WOHelperFunctionBindingNameAssociation)
<ognl.helperfunction.WOHelperFunctionBindingNameAssociation:
keyPath=^action>
On Jun 25, 2009, at 10:19 PM, Chuck Hill wrote:
On Jun 25, 2009, at 7:10 PM, Ricardo J. Parada wrote:
On Jun 25, 2009, at 9:53 PM, Chuck Hill wrote:
Sigh...
Does anybody see anything obvious in this stack trace? I used
to have this exception ages ago and it was obscure. I don't
recall what ended up fixing it exactly but now that I moved my
application to Wonder I'm running into this again and haven't
figured out yet why or how to fix it. Any ideas??
Pleeeassee!! :-)
I have seen this before. It is caused by the context not
knowing the current component. This is hitting some action
method. What is it returning?
I see in the stack trace that it's going through the
invokeAction phase. But the action method that is supposed to
get called has not been called yet. I set a breakpoint in the
method that it's supposed to get called but I hit the exception
first and the action method never gets called.
I'll set a breakpoint in the invokeAction() method of the
component that is supposed to call the action to see how things
look from there.
From what I can tell the _popComponentFromContext() gets the
current component from the context and then to message it and
throws the null pointer exception because the current component
is null for some obscure reason.
Anyways, I'm taking a look at the invokeAction in my component.
I really ought to take better notes when I hit things like this.
Chuck
--
Chuck Hill Senior Consultant / VP Development
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
--
Chuck Hill Senior Consultant / VP Development
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