You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Sean Schofield <se...@gmail.com> on 2005/04/02 04:30:16 UTC
Re: getNodeId() returning null in tree2
I still need some time to think about what the problem might be. I
have a lot of personal stuff going on that's keeping me busy at the
moment. Plus I am working on some stuff related to the new website,
etc.
I will get back to you shortly though.
sean
On Mar 31, 2005 4:30 PM, Jon Travis <jt...@p00p.org> wrote:
> Ack!
>
> Replace 'false' with null (hence the NPE).
>
> The NPE occurs in HtmlTree.isNodeSelected() -- it
> does:
>
> return getNodeId().equals(_selectedNodeId)
>
> getNodeId() returns false. Up the stack, this
> is being called from DebugUtils.printComponent.
>
> -- Jon
>
>
> On Mar 31, 2005, at 6:04 AM, Sean Schofield wrote:
>
> > Jon,
> >
> > When you say getNodeId returns false, do you mean the string value
> > "false"? That method returns a String so I'm a bit confused. How do
> > you know the id is "false"? Are you doing a debug statement?
> >
> > Please clarify so I can try and help you. Also, what is the exact
> > line where the NPE occurs? Is it the return statement in
> > isNodeExpanded? If so (and if you have a debugger) it would be
> > helpful to know which value is null.
> >
> > Regards,
> > sean
> >
> > ps. I forwarded this to the myfaces list in case anyone else has the
> > same problem. These messages are also archived so if someone has the
> > same question in the future they can get information by doing a quick
> > search.
> >
> >
> > On Thu, 31 Mar 2005 08:55:00 -0500, Sean Schofield
> > <se...@gmail.com> wrote:
> >> ---------- Forwarded message ----------
> >> From: Jon Travis <jt...@p00p.org>
> >> Date: Wed, 30 Mar 2005 17:32:19 -0800
> >> Subject: getNodeId() returning null in tree2
> >> To: Sean Schofield <se...@gmail.com>
> >>
> >> Hey Sean,
> >>
> >> Hope this isn't a braindead question, but:
> >>
> >> I'm getting a NPE in the tree2 code when there is
> >> no node that is selected & I am expanding/collapsing.
> >>
> >> Basically it comes about when HtmlTree.isNodeSelected
> >> is run -- getNodeId() returns false, then kaboom.
> >>
> >> Thoughts?
> >>
> >> -- Jon
> >>
> >
> >
>
>
Re: getNodeId() returning null in tree2
Posted by Jon Travis <jt...@p00p.org>.
My data isn't changing. This only manifests itself
when I'm using the server-side tree, BTW. Client-side
everything works peachy.
-- Jon
On Apr 2, 2005, at 10:14 AM, Rob Decker wrote:
> I don't think it has to do with any mutation in the tree. I think that
> the
> isNodeSelected method is simply being called before the nodeId has
> been set
> on the object. It gets called again later when the nodeId is set. I
> tested
> the fix I put in the bug report and it had no side effects. The
> processing
> of the jsp page must iterate over the tags a number of times and in the
> early iterations the components are not yet fully initialized.
>
> Rob
>
> ----- Original Message -----
> From: "Sean Schofield" <se...@gmail.com>
> To: "MyFaces Discussion" <my...@incubator.apache.org>
> Sent: Saturday, April 02, 2005 1:00 PM
> Subject: Re: getNodeId() returning null in tree2
>
>
>> Are we sure that is it? This would imply that the structure of his
>> tree is changing between posts. That was the problem in MYFACES-160
>> but you had a pretty unusual case where you simulating the tree
>> changing between *every* post.
>>
>> Jon, does this sound like it applies to you? Is your data changing
>> between posts?
>>
>> sean
>>
>>
>> On Apr 1, 2005 10:09 PM, Rob Decker <ro...@objectsource.org> wrote:
>>> This is the bug I reported about isNodeSelected() throwing a
>>> NullPointerException because getNodeId() returns a null nodeId.
>>> http://issues.apache.org/jira/browse/MYFACES-160
>>>
>>> I put the fix in the bug report. It's null because it hasn't been set
> yet.
>>>
>>>
>>> ----- Original Message -----
>>> From: "Sean Schofield" <se...@gmail.com>
>>> To: "MyFaces Discussion" <my...@incubator.apache.org>
>>> Sent: Friday, April 01, 2005 9:30 PM
>>> Subject: Re: getNodeId() returning null in tree2
>>>
>>>> I still need some time to think about what the problem might be. I
>>>> have a lot of personal stuff going on that's keeping me busy at the
>>>> moment. Plus I am working on some stuff related to the new website,
>>>> etc.
>>>>
>>>> I will get back to you shortly though.
>>>>
>>>> sean
>>>>
>>>>
>>>> On Mar 31, 2005 4:30 PM, Jon Travis <jt...@p00p.org> wrote:
>>>>> Ack!
>>>>>
>>>>> Replace 'false' with null (hence the NPE).
>>>>>
>>>>> The NPE occurs in HtmlTree.isNodeSelected() -- it
>>>>> does:
>>>>>
>>>>> return getNodeId().equals(_selectedNodeId)
>>>>>
>>>>> getNodeId() returns false. Up the stack, this
>>>>> is being called from DebugUtils.printComponent.
>>>>>
>>>>> -- Jon
>>>>>
>>>>>
>>>>> On Mar 31, 2005, at 6:04 AM, Sean Schofield wrote:
>>>>>
>>>>>> Jon,
>>>>>>
>>>>>> When you say getNodeId returns false, do you mean the string value
>>>>>> "false"? That method returns a String so I'm a bit confused. How
> do
>>>>>> you know the id is "false"? Are you doing a debug statement?
>>>>>>
>>>>>> Please clarify so I can try and help you. Also, what is the exact
>>>>>> line where the NPE occurs? Is it the return statement in
>>>>>> isNodeExpanded? If so (and if you have a debugger) it would be
>>>>>> helpful to know which value is null.
>>>>>>
>>>>>> Regards,
>>>>>> sean
>>>>>>
>>>>>> ps. I forwarded this to the myfaces list in case anyone else has
> the
>>>>>> same problem. These messages are also archived so if someone has
> the
>>>>>> same question in the future they can get information by doing a
> quick
>>>>>> search.
>>>>>>
>>>>>>
>>>>>> On Thu, 31 Mar 2005 08:55:00 -0500, Sean Schofield
>>>>>> <se...@gmail.com> wrote:
>>>>>>> ---------- Forwarded message ----------
>>>>>>> From: Jon Travis <jt...@p00p.org>
>>>>>>> Date: Wed, 30 Mar 2005 17:32:19 -0800
>>>>>>> Subject: getNodeId() returning null in tree2
>>>>>>> To: Sean Schofield <se...@gmail.com>
>>>>>>>
>>>>>>> Hey Sean,
>>>>>>>
>>>>>>> Hope this isn't a braindead question, but:
>>>>>>>
>>>>>>> I'm getting a NPE in the tree2 code when there is
>>>>>>> no node that is selected & I am expanding/collapsing.
>>>>>>>
>>>>>>> Basically it comes about when HtmlTree.isNodeSelected
>>>>>>> is run -- getNodeId() returns false, then kaboom.
>>>>>>>
>>>>>>> Thoughts?
>>>>>>>
>>>>>>> -- Jon
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
>
Re: getNodeId() returning null in tree2
Posted by Rob Decker <ro...@objectsource.org>.
Maybe you don't have logging turned on for the package? I'm using log4j and
have the myfaces package set to ERROR. I think it only happens with
server-side processing too.
Rob
----- Original Message -----
From: "Sean Schofield" <se...@gmail.com>
To: "MyFaces Discussion" <my...@incubator.apache.org>
Sent: Sunday, April 03, 2005 10:27 PM
Subject: Re: getNodeId() returning null in tree2
> [snip]
>
> > The processing of the jsp page must iterate over the tags a number of
times and in the
> > early iterations the components are not yet fully initialized.
>
> I don't understand why I haven't seen this myself when I am working
> with tree2. I'd like to understand more about what is happening
> behind the scenes here. I hope to take a closer look tomorrow
> (Monday.) I saw your fix in JIRA. It looks good. I'm going to hold
> off adding it until I can understand why this is happening (otherwise
> I will get lazy and stop thinking about it.)
>
> > Rob
>
> sean
Re: getNodeId() returning null in tree2
Posted by Sean Schofield <se...@gmail.com>.
Yes I am running on Windows. I agree that it shouldn't make any
difference. Generally I do my testing through JBuilder's integrated
Tomcat. Its possible that I don't have log4j configured correctly (or
at all.) I will check tomorrow to verify.
sean
On Apr 3, 2005 10:51 PM, Rob Decker <ro...@objectsource.org> wrote:
> Are you running on Windows? I haven't seen this when running on Windows.
> I've only seen it when running on Linux. Not that I can think of why that
> should make a difference, but it's what I've observered.
>
>
> ----- Original Message -----
> From: "Sean Schofield" <se...@gmail.com>
> To: "MyFaces Discussion" <my...@incubator.apache.org>
> Sent: Sunday, April 03, 2005 10:27 PM
> Subject: Re: getNodeId() returning null in tree2
>
> > [snip]
> >
> > > The processing of the jsp page must iterate over the tags a number of
> times and in the
> > > early iterations the components are not yet fully initialized.
> >
> > I don't understand why I haven't seen this myself when I am working
> > with tree2. I'd like to understand more about what is happening
> > behind the scenes here. I hope to take a closer look tomorrow
> > (Monday.) I saw your fix in JIRA. It looks good. I'm going to hold
> > off adding it until I can understand why this is happening (otherwise
> > I will get lazy and stop thinking about it.)
> >
> > > Rob
> >
> > sean
>
>
Re: getNodeId() returning null in tree2
Posted by Rob Decker <ro...@objectsource.org>.
Are you running on Windows? I haven't seen this when running on Windows.
I've only seen it when running on Linux. Not that I can think of why that
should make a difference, but it's what I've observered.
----- Original Message -----
From: "Sean Schofield" <se...@gmail.com>
To: "MyFaces Discussion" <my...@incubator.apache.org>
Sent: Sunday, April 03, 2005 10:27 PM
Subject: Re: getNodeId() returning null in tree2
> [snip]
>
> > The processing of the jsp page must iterate over the tags a number of
times and in the
> > early iterations the components are not yet fully initialized.
>
> I don't understand why I haven't seen this myself when I am working
> with tree2. I'd like to understand more about what is happening
> behind the scenes here. I hope to take a closer look tomorrow
> (Monday.) I saw your fix in JIRA. It looks good. I'm going to hold
> off adding it until I can understand why this is happening (otherwise
> I will get lazy and stop thinking about it.)
>
> > Rob
>
> sean
Re: getNodeId() returning null in tree2
Posted by Sean Schofield <se...@gmail.com>.
[snip]
> The processing of the jsp page must iterate over the tags a number of times and in the
> early iterations the components are not yet fully initialized.
I don't understand why I haven't seen this myself when I am working
with tree2. I'd like to understand more about what is happening
behind the scenes here. I hope to take a closer look tomorrow
(Monday.) I saw your fix in JIRA. It looks good. I'm going to hold
off adding it until I can understand why this is happening (otherwise
I will get lazy and stop thinking about it.)
> Rob
sean
Re: getNodeId() returning null in tree2
Posted by Rob Decker <ro...@objectsource.org>.
I don't think it has to do with any mutation in the tree. I think that the
isNodeSelected method is simply being called before the nodeId has been set
on the object. It gets called again later when the nodeId is set. I tested
the fix I put in the bug report and it had no side effects. The processing
of the jsp page must iterate over the tags a number of times and in the
early iterations the components are not yet fully initialized.
Rob
----- Original Message -----
From: "Sean Schofield" <se...@gmail.com>
To: "MyFaces Discussion" <my...@incubator.apache.org>
Sent: Saturday, April 02, 2005 1:00 PM
Subject: Re: getNodeId() returning null in tree2
> Are we sure that is it? This would imply that the structure of his
> tree is changing between posts. That was the problem in MYFACES-160
> but you had a pretty unusual case where you simulating the tree
> changing between *every* post.
>
> Jon, does this sound like it applies to you? Is your data changing
> between posts?
>
> sean
>
>
> On Apr 1, 2005 10:09 PM, Rob Decker <ro...@objectsource.org> wrote:
> > This is the bug I reported about isNodeSelected() throwing a
> > NullPointerException because getNodeId() returns a null nodeId.
> > http://issues.apache.org/jira/browse/MYFACES-160
> >
> > I put the fix in the bug report. It's null because it hasn't been set
yet.
> >
> >
> > ----- Original Message -----
> > From: "Sean Schofield" <se...@gmail.com>
> > To: "MyFaces Discussion" <my...@incubator.apache.org>
> > Sent: Friday, April 01, 2005 9:30 PM
> > Subject: Re: getNodeId() returning null in tree2
> >
> > > I still need some time to think about what the problem might be. I
> > > have a lot of personal stuff going on that's keeping me busy at the
> > > moment. Plus I am working on some stuff related to the new website,
> > > etc.
> > >
> > > I will get back to you shortly though.
> > >
> > > sean
> > >
> > >
> > > On Mar 31, 2005 4:30 PM, Jon Travis <jt...@p00p.org> wrote:
> > > > Ack!
> > > >
> > > > Replace 'false' with null (hence the NPE).
> > > >
> > > > The NPE occurs in HtmlTree.isNodeSelected() -- it
> > > > does:
> > > >
> > > > return getNodeId().equals(_selectedNodeId)
> > > >
> > > > getNodeId() returns false. Up the stack, this
> > > > is being called from DebugUtils.printComponent.
> > > >
> > > > -- Jon
> > > >
> > > >
> > > > On Mar 31, 2005, at 6:04 AM, Sean Schofield wrote:
> > > >
> > > > > Jon,
> > > > >
> > > > > When you say getNodeId returns false, do you mean the string value
> > > > > "false"? That method returns a String so I'm a bit confused. How
do
> > > > > you know the id is "false"? Are you doing a debug statement?
> > > > >
> > > > > Please clarify so I can try and help you. Also, what is the exact
> > > > > line where the NPE occurs? Is it the return statement in
> > > > > isNodeExpanded? If so (and if you have a debugger) it would be
> > > > > helpful to know which value is null.
> > > > >
> > > > > Regards,
> > > > > sean
> > > > >
> > > > > ps. I forwarded this to the myfaces list in case anyone else has
the
> > > > > same problem. These messages are also archived so if someone has
the
> > > > > same question in the future they can get information by doing a
quick
> > > > > search.
> > > > >
> > > > >
> > > > > On Thu, 31 Mar 2005 08:55:00 -0500, Sean Schofield
> > > > > <se...@gmail.com> wrote:
> > > > >> ---------- Forwarded message ----------
> > > > >> From: Jon Travis <jt...@p00p.org>
> > > > >> Date: Wed, 30 Mar 2005 17:32:19 -0800
> > > > >> Subject: getNodeId() returning null in tree2
> > > > >> To: Sean Schofield <se...@gmail.com>
> > > > >>
> > > > >> Hey Sean,
> > > > >>
> > > > >> Hope this isn't a braindead question, but:
> > > > >>
> > > > >> I'm getting a NPE in the tree2 code when there is
> > > > >> no node that is selected & I am expanding/collapsing.
> > > > >>
> > > > >> Basically it comes about when HtmlTree.isNodeSelected
> > > > >> is run -- getNodeId() returns false, then kaboom.
> > > > >>
> > > > >> Thoughts?
> > > > >>
> > > > >> -- Jon
> > > > >>
> > > > >
> > > > >
> > > >
> > > >
> >
> >
Re: getNodeId() returning null in tree2
Posted by Sean Schofield <se...@gmail.com>.
Are we sure that is it? This would imply that the structure of his
tree is changing between posts. That was the problem in MYFACES-160
but you had a pretty unusual case where you simulating the tree
changing between *every* post.
Jon, does this sound like it applies to you? Is your data changing
between posts?
sean
On Apr 1, 2005 10:09 PM, Rob Decker <ro...@objectsource.org> wrote:
> This is the bug I reported about isNodeSelected() throwing a
> NullPointerException because getNodeId() returns a null nodeId.
> http://issues.apache.org/jira/browse/MYFACES-160
>
> I put the fix in the bug report. It's null because it hasn't been set yet.
>
>
> ----- Original Message -----
> From: "Sean Schofield" <se...@gmail.com>
> To: "MyFaces Discussion" <my...@incubator.apache.org>
> Sent: Friday, April 01, 2005 9:30 PM
> Subject: Re: getNodeId() returning null in tree2
>
> > I still need some time to think about what the problem might be. I
> > have a lot of personal stuff going on that's keeping me busy at the
> > moment. Plus I am working on some stuff related to the new website,
> > etc.
> >
> > I will get back to you shortly though.
> >
> > sean
> >
> >
> > On Mar 31, 2005 4:30 PM, Jon Travis <jt...@p00p.org> wrote:
> > > Ack!
> > >
> > > Replace 'false' with null (hence the NPE).
> > >
> > > The NPE occurs in HtmlTree.isNodeSelected() -- it
> > > does:
> > >
> > > return getNodeId().equals(_selectedNodeId)
> > >
> > > getNodeId() returns false. Up the stack, this
> > > is being called from DebugUtils.printComponent.
> > >
> > > -- Jon
> > >
> > >
> > > On Mar 31, 2005, at 6:04 AM, Sean Schofield wrote:
> > >
> > > > Jon,
> > > >
> > > > When you say getNodeId returns false, do you mean the string value
> > > > "false"? That method returns a String so I'm a bit confused. How do
> > > > you know the id is "false"? Are you doing a debug statement?
> > > >
> > > > Please clarify so I can try and help you. Also, what is the exact
> > > > line where the NPE occurs? Is it the return statement in
> > > > isNodeExpanded? If so (and if you have a debugger) it would be
> > > > helpful to know which value is null.
> > > >
> > > > Regards,
> > > > sean
> > > >
> > > > ps. I forwarded this to the myfaces list in case anyone else has the
> > > > same problem. These messages are also archived so if someone has the
> > > > same question in the future they can get information by doing a quick
> > > > search.
> > > >
> > > >
> > > > On Thu, 31 Mar 2005 08:55:00 -0500, Sean Schofield
> > > > <se...@gmail.com> wrote:
> > > >> ---------- Forwarded message ----------
> > > >> From: Jon Travis <jt...@p00p.org>
> > > >> Date: Wed, 30 Mar 2005 17:32:19 -0800
> > > >> Subject: getNodeId() returning null in tree2
> > > >> To: Sean Schofield <se...@gmail.com>
> > > >>
> > > >> Hey Sean,
> > > >>
> > > >> Hope this isn't a braindead question, but:
> > > >>
> > > >> I'm getting a NPE in the tree2 code when there is
> > > >> no node that is selected & I am expanding/collapsing.
> > > >>
> > > >> Basically it comes about when HtmlTree.isNodeSelected
> > > >> is run -- getNodeId() returns false, then kaboom.
> > > >>
> > > >> Thoughts?
> > > >>
> > > >> -- Jon
> > > >>
> > > >
> > > >
> > >
> > >
>
>
Re: getNodeId() returning null in tree2
Posted by Rob Decker <ro...@objectsource.org>.
This is the bug I reported about isNodeSelected() throwing a
NullPointerException because getNodeId() returns a null nodeId.
http://issues.apache.org/jira/browse/MYFACES-160
I put the fix in the bug report. It's null because it hasn't been set yet.
----- Original Message -----
From: "Sean Schofield" <se...@gmail.com>
To: "MyFaces Discussion" <my...@incubator.apache.org>
Sent: Friday, April 01, 2005 9:30 PM
Subject: Re: getNodeId() returning null in tree2
> I still need some time to think about what the problem might be. I
> have a lot of personal stuff going on that's keeping me busy at the
> moment. Plus I am working on some stuff related to the new website,
> etc.
>
> I will get back to you shortly though.
>
> sean
>
>
> On Mar 31, 2005 4:30 PM, Jon Travis <jt...@p00p.org> wrote:
> > Ack!
> >
> > Replace 'false' with null (hence the NPE).
> >
> > The NPE occurs in HtmlTree.isNodeSelected() -- it
> > does:
> >
> > return getNodeId().equals(_selectedNodeId)
> >
> > getNodeId() returns false. Up the stack, this
> > is being called from DebugUtils.printComponent.
> >
> > -- Jon
> >
> >
> > On Mar 31, 2005, at 6:04 AM, Sean Schofield wrote:
> >
> > > Jon,
> > >
> > > When you say getNodeId returns false, do you mean the string value
> > > "false"? That method returns a String so I'm a bit confused. How do
> > > you know the id is "false"? Are you doing a debug statement?
> > >
> > > Please clarify so I can try and help you. Also, what is the exact
> > > line where the NPE occurs? Is it the return statement in
> > > isNodeExpanded? If so (and if you have a debugger) it would be
> > > helpful to know which value is null.
> > >
> > > Regards,
> > > sean
> > >
> > > ps. I forwarded this to the myfaces list in case anyone else has the
> > > same problem. These messages are also archived so if someone has the
> > > same question in the future they can get information by doing a quick
> > > search.
> > >
> > >
> > > On Thu, 31 Mar 2005 08:55:00 -0500, Sean Schofield
> > > <se...@gmail.com> wrote:
> > >> ---------- Forwarded message ----------
> > >> From: Jon Travis <jt...@p00p.org>
> > >> Date: Wed, 30 Mar 2005 17:32:19 -0800
> > >> Subject: getNodeId() returning null in tree2
> > >> To: Sean Schofield <se...@gmail.com>
> > >>
> > >> Hey Sean,
> > >>
> > >> Hope this isn't a braindead question, but:
> > >>
> > >> I'm getting a NPE in the tree2 code when there is
> > >> no node that is selected & I am expanding/collapsing.
> > >>
> > >> Basically it comes about when HtmlTree.isNodeSelected
> > >> is run -- getNodeId() returns false, then kaboom.
> > >>
> > >> Thoughts?
> > >>
> > >> -- Jon
> > >>
> > >
> > >
> >
> >