You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nicolas Charles <nc...@linagora.com> on 2008/12/01 17:35:02 UTC

Re: [T5] Palette NPE

I just had this issue; it was because the object overrided the "equals" 
method, but not "hashCode", hence the selected object couldn't be found 
in the selected set.

Nick


zack1403 wrote:
> Bump for help on this?  Is the because genericSelectModel.getOptionGroups
> returns null?  
>
> This occurs intermitently and I havent been able to find a workaround.
>
> Zack
>
>
> zack1403 wrote:
>   
>> Hey All,
>>
>> I'm getting a NullPointerException when the palette component in 5.0.16:
>>
>> Caused by: java.lang.NullPointerException
>> 	at
>> org.apache.tapestry5.internal.util.SelectModelRenderer.option(SelectModelRenderer.java:49)
>> 	at
>> org.apache.tapestry5.corelib.components.Palette$SelectedRenderer.render(Palette.java:147)
>> 	at
>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$RenderPhaseEventHandler$1.render(ComponentPageElementImpl.java:164)
>> 	at
>> org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72)
>>
>> I'm populating the palette using the code below:
>>
>> selectEncoder = new
>> GenericValueEncoder<StringBean>(this.spreadsheetHeaders);
>> selectModel = new GenericSelectModel<StringBean>(this.spreadsheetHeaders,
>> StringBean.class, "value", "value", propertyAccess);
>>
>> Am I using this correctly?
>>
>> Thanks,
>> Zack
>>
>>     
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Palette NPE

Posted by zack1403 <za...@gmail.com>.
Alright, my list I was feeding palette was set to final and was instantiated
with a new list.  By removing the final and instantiation the issue went
away.  Should I file this as a bug?

Zack


zack1403 wrote:
> 
> Happening again using GenericSelectModel for model and encoder.  Anyone
> have any clue what I might be doing wrong? I discarding persistent field
> changes after a certain action so I have a fresh start when it happens
> each time.  I seems completely random why this is showing up.
> 
> Zack
> 
> 
> zack1403 wrote:
>> 
>> Unfortunately I was passing it a List :(  Hasn't happened since I stared
>> using GenericSelectModel for both model and encoder but thats not to say
>> it wont.  Thanks anyways!
>> 
>> Zack
>> 
>> 
>> James Hillyerd wrote:
>>> 
>>> Probably not related to your problem, but I was seeing an NPE from the
>>> exact
>>> same line of code when passing the palette a Set (instead of a List).
>>> 
>>> -james
>>> 
>>> On Wed, Dec 3, 2008 at 11:27 AM, zack1403 <za...@gmail.com>
>>> wrote:
>>> 
>>>>
>>>> Ive overridden both equals and hashCode (neither were overridden
>>>> before)
>>>> and
>>>> have been waiting for the issue to reproduce.  It is very intermittent
>>>> and
>>>> a
>>>> simple f5 makes it go away which is frustrating.  I also am trying
>>>> using
>>>> GenericSelectModel as the encoder and model which might make the issue
>>>> go
>>>> away.  Ill follow up if that fixes it.  Thanks!
>>>>
>>>> Zack
>>>>
>>>>
>>>> Nicolas Charles wrote:
>>>> >
>>>> > I just had this issue; it was because the object overrided the
>>>> "equals"
>>>> > method, but not "hashCode", hence the selected object couldn't be
>>>> found
>>>> > in the selected set.
>>>> >
>>>> > Nick
>>>> >
>>>> >
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/-T5--Palette-NPE-tp20652729p20819782.html
>>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>> 
>>> 
>>> -- 
>>> James A. Hillyerd <ja...@hillyerd.com>
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-T5--Palette-NPE-tp20652729p20829014.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Palette NPE

Posted by zack1403 <za...@gmail.com>.
Happening again using GenericSelectModel for model and encoder.  Anyone have
any clue what I might be doing wrong? I discarding persistent field changes
after a certain action so I have a fresh start when it happens each time.  I
seems completely random why this is showing up.

Zack


zack1403 wrote:
> 
> Unfortunately I was passing it a List :(  Hasn't happened since I stared
> using GenericSelectModel for both model and encoder but thats not to say
> it wont.  Thanks anyways!
> 
> Zack
> 
> 
> James Hillyerd wrote:
>> 
>> Probably not related to your problem, but I was seeing an NPE from the
>> exact
>> same line of code when passing the palette a Set (instead of a List).
>> 
>> -james
>> 
>> On Wed, Dec 3, 2008 at 11:27 AM, zack1403 <za...@gmail.com> wrote:
>> 
>>>
>>> Ive overridden both equals and hashCode (neither were overridden before)
>>> and
>>> have been waiting for the issue to reproduce.  It is very intermittent
>>> and
>>> a
>>> simple f5 makes it go away which is frustrating.  I also am trying using
>>> GenericSelectModel as the encoder and model which might make the issue
>>> go
>>> away.  Ill follow up if that fixes it.  Thanks!
>>>
>>> Zack
>>>
>>>
>>> Nicolas Charles wrote:
>>> >
>>> > I just had this issue; it was because the object overrided the
>>> "equals"
>>> > method, but not "hashCode", hence the selected object couldn't be
>>> found
>>> > in the selected set.
>>> >
>>> > Nick
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/-T5--Palette-NPE-tp20652729p20819782.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>> 
>> 
>> -- 
>> James A. Hillyerd <ja...@hillyerd.com>
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-T5--Palette-NPE-tp20652729p20828345.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Palette NPE

Posted by zack1403 <za...@gmail.com>.
Unfortunately I was passing it a List :(  Hasn't happened since I stared
using GenericSelectModel for both model and encoder but thats not to say it
wont.  Thanks anyways!

Zack


James Hillyerd wrote:
> 
> Probably not related to your problem, but I was seeing an NPE from the
> exact
> same line of code when passing the palette a Set (instead of a List).
> 
> -james
> 
> On Wed, Dec 3, 2008 at 11:27 AM, zack1403 <za...@gmail.com> wrote:
> 
>>
>> Ive overridden both equals and hashCode (neither were overridden before)
>> and
>> have been waiting for the issue to reproduce.  It is very intermittent
>> and
>> a
>> simple f5 makes it go away which is frustrating.  I also am trying using
>> GenericSelectModel as the encoder and model which might make the issue go
>> away.  Ill follow up if that fixes it.  Thanks!
>>
>> Zack
>>
>>
>> Nicolas Charles wrote:
>> >
>> > I just had this issue; it was because the object overrided the "equals"
>> > method, but not "hashCode", hence the selected object couldn't be found
>> > in the selected set.
>> >
>> > Nick
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-T5--Palette-NPE-tp20652729p20819782.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> -- 
> James A. Hillyerd <ja...@hillyerd.com>
> 
> 

-- 
View this message in context: http://www.nabble.com/-T5--Palette-NPE-tp20652729p20825265.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Palette NPE

Posted by James Hillyerd <ja...@hillyerd.com>.
Probably not related to your problem, but I was seeing an NPE from the exact
same line of code when passing the palette a Set (instead of a List).

-james

On Wed, Dec 3, 2008 at 11:27 AM, zack1403 <za...@gmail.com> wrote:

>
> Ive overridden both equals and hashCode (neither were overridden before)
> and
> have been waiting for the issue to reproduce.  It is very intermittent and
> a
> simple f5 makes it go away which is frustrating.  I also am trying using
> GenericSelectModel as the encoder and model which might make the issue go
> away.  Ill follow up if that fixes it.  Thanks!
>
> Zack
>
>
> Nicolas Charles wrote:
> >
> > I just had this issue; it was because the object overrided the "equals"
> > method, but not "hashCode", hence the selected object couldn't be found
> > in the selected set.
> >
> > Nick
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/-T5--Palette-NPE-tp20652729p20819782.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
James A. Hillyerd <ja...@hillyerd.com>

Re: [T5] Palette NPE

Posted by zack1403 <za...@gmail.com>.
Ive overridden both equals and hashCode (neither were overridden before) and
have been waiting for the issue to reproduce.  It is very intermittent and a
simple f5 makes it go away which is frustrating.  I also am trying using
GenericSelectModel as the encoder and model which might make the issue go
away.  Ill follow up if that fixes it.  Thanks!

Zack


Nicolas Charles wrote:
> 
> I just had this issue; it was because the object overrided the "equals" 
> method, but not "hashCode", hence the selected object couldn't be found 
> in the selected set.
> 
> Nick
> 
> 

-- 
View this message in context: http://www.nabble.com/-T5--Palette-NPE-tp20652729p20819782.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org