You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jonny Wray <jo...@yahoo.com> on 2004/02/06 03:38:43 UTC

Null values after some period of inactivity

Hi there, I'm relatively new to tapestery so I'm sure I'm missing
something obvious here. The problem is I get the following error:

Value for parameter 'listener' in component
SearchResults/resultTable.link is null, and a non-null value is
required.

when I activate a link after the session has been idle for a while. I'm
using a DirectLink component inside my own LinkedTable which is used in
the above mentioned SearchResults page.

In SearchResults.page: (tableValueListener is a listener in the page
code)

<component id="resultTable" type="LinkedTable">
  <static-binding name="dataSource">resultList</static-binding>
  <binding name="linkListener"
expression="listeners.tableValueListener" />
</component>

In LinkedTable.jwc:

<parameter name="dataSource" type="java.lang.String" required="yes"
direction="in" />

<parameter name="linkListener"
type="org.apache.tapestry.IActionListener" 
    	required="yes" direction="in" />


<component id="link" type="DirectLink">
   <binding name="listener" expression="linkListener" />
   <binding name="parameters" expression="currentParameter" />
   <binding name="disabled" expression= "currentDisabled" />
</component>

In my LinkedTable java I have an instance variable linkListener with
getters and setters and I reset it to null in initialize.

Any idea why I'm getting this error when my session has been inactive
for a while?

thanks in advance,
Jonny




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


Re: Null values after some period of inactivity

Posted by Sándor Norbert <sa...@mail.datanet.hu>.
Maybe your session expires and the persistent properties are reset to their
initial value.
I use the validate() method to avoid exceptions in this case.

Norbi

----- Original Message ----- 
From: "Jonny Wray" <jo...@yahoo.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, February 06, 2004 3:38 AM
Subject: Null values after some period of inactivity


>
> Hi there, I'm relatively new to tapestery so I'm sure I'm missing
> something obvious here. The problem is I get the following error:
>
> Value for parameter 'listener' in component
> SearchResults/resultTable.link is null, and a non-null value is
> required.
>
> when I activate a link after the session has been idle for a while. I'm
> using a DirectLink component inside my own LinkedTable which is used in
> the above mentioned SearchResults page.
>
> In SearchResults.page: (tableValueListener is a listener in the page
> code)
>
> <component id="resultTable" type="LinkedTable">
>   <static-binding name="dataSource">resultList</static-binding>
>   <binding name="linkListener"
> expression="listeners.tableValueListener" />
> </component>
>
> In LinkedTable.jwc:
>
> <parameter name="dataSource" type="java.lang.String" required="yes"
> direction="in" />
>
> <parameter name="linkListener"
> type="org.apache.tapestry.IActionListener"
>     required="yes" direction="in" />
>
>
> <component id="link" type="DirectLink">
>    <binding name="listener" expression="linkListener" />
>    <binding name="parameters" expression="currentParameter" />
>    <binding name="disabled" expression= "currentDisabled" />
> </component>
>
> In my LinkedTable java I have an instance variable linkListener with
> getters and setters and I reset it to null in initialize.
>
> Any idea why I'm getting this error when my session has been inactive
> for a while?
>
> thanks in advance,
> Jonny
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>



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


Re: Null values after some period of inactivity

Posted by Marilen Corciovei <le...@nemesisit.rdsnet.ro>.
Another problem I encountered is when you have values set in your page
or component class. This class is stored in the tapestry pool for some
time and then lost. Check that you nullified all class variables on
detach. If you do so and the problem was there then you will get the
error without timeout.

Len


On Fri, 2004-02-06 at 07:00, Bryan Lewis wrote:

> I saw something like this once.  I had an ognl expression that
> referenced a component's parameter.  After the app sat for a while (and
> only then), I got an error "Unable to resolve expression."  My guess was
> that the variable was being garbage collected by Java.
> 
> I fixed it by moving the expression from the html to the java code.
> This failed:
> 
> .html:
>     <span jwcid="@Shell" title="ognl:'MyApp ' + title" ...>
> where 'title' was a typical instance variable with accessor methods.
> 
> This worked:
> 
> .html:
>     <span jwcid="@Shell" title="ognl:donutTitle" ...>
> .java:
>     public String getDonutTitle() { return "MyApp " + title; }
> 
> Maybe that will give you a clue of where to start looking.  You might
> add log statements to see which of your component's parameters is
> getting cleaned up. Adding code to force g.c. might help testing.  If
> you isolate the parameter, enclosing it in a method (or making it
> persistent somehow) might help.  Perhaps there's some subtle bug in the
> ognl/tapestry interface such that references to parameters aren't hard
> references and are subject to garbage collection.
> 
> 
> 
> ----- Original Message ----- 
> From: "Jonny Wray" <jo...@yahoo.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Thursday, February 05, 2004 9:38 PM
> Subject: Null values after some period of inactivity
> 
> 
> >
> > Hi there, I'm relatively new to tapestery so I'm sure I'm missing
> > something obvious here. The problem is I get the following error:
> >
> > Value for parameter 'listener' in component
> > SearchResults/resultTable.link is null, and a non-null value is
> > required.
> >
> > when I activate a link after the session has been idle for a while.
> I'm
> > using a DirectLink component inside my own LinkedTable which is used
> in
> > the above mentioned SearchResults page.
> >
> > In SearchResults.page: (tableValueListener is a listener in the page
> > code)
> >
> > <component id="resultTable" type="LinkedTable">
> >   <static-binding name="dataSource">resultList</static-binding>
> >   <binding name="linkListener"
> > expression="listeners.tableValueListener" />
> > </component>
> >
> > In LinkedTable.jwc:
> >
> > <parameter name="dataSource" type="java.lang.String" required="yes"
> > direction="in" />
> >
> > <parameter name="linkListener"
> > type="org.apache.tapestry.IActionListener"
> >     required="yes" direction="in" />
> >
> >
> > <component id="link" type="DirectLink">
> >    <binding name="listener" expression="linkListener" />
> >    <binding name="parameters" expression="currentParameter" />
> >    <binding name="disabled" expression= "currentDisabled" />
> > </component>
> >
> > In my LinkedTable java I have an instance variable linkListener with
> > getters and setters and I reset it to null in initialize.
> >
> > Any idea why I'm getting this error when my session has been inactive
> > for a while?
> >
> > thanks in advance,
> > Jonny
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



Re: Null values after some period of inactivity

Posted by Bryan Lewis <br...@maine.rr.com>.
I saw something like this once.  I had an ognl expression that
referenced a component's parameter.  After the app sat for a while (and
only then), I got an error "Unable to resolve expression."  My guess was
that the variable was being garbage collected by Java.

I fixed it by moving the expression from the html to the java code.
This failed:

.html:
    <span jwcid="@Shell" title="ognl:'MyApp ' + title" ...>
where 'title' was a typical instance variable with accessor methods.

This worked:

.html:
    <span jwcid="@Shell" title="ognl:donutTitle" ...>
.java:
    public String getDonutTitle() { return "MyApp " + title; }

Maybe that will give you a clue of where to start looking.  You might
add log statements to see which of your component's parameters is
getting cleaned up. Adding code to force g.c. might help testing.  If
you isolate the parameter, enclosing it in a method (or making it
persistent somehow) might help.  Perhaps there's some subtle bug in the
ognl/tapestry interface such that references to parameters aren't hard
references and are subject to garbage collection.



----- Original Message ----- 
From: "Jonny Wray" <jo...@yahoo.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, February 05, 2004 9:38 PM
Subject: Null values after some period of inactivity


>
> Hi there, I'm relatively new to tapestery so I'm sure I'm missing
> something obvious here. The problem is I get the following error:
>
> Value for parameter 'listener' in component
> SearchResults/resultTable.link is null, and a non-null value is
> required.
>
> when I activate a link after the session has been idle for a while.
I'm
> using a DirectLink component inside my own LinkedTable which is used
in
> the above mentioned SearchResults page.
>
> In SearchResults.page: (tableValueListener is a listener in the page
> code)
>
> <component id="resultTable" type="LinkedTable">
>   <static-binding name="dataSource">resultList</static-binding>
>   <binding name="linkListener"
> expression="listeners.tableValueListener" />
> </component>
>
> In LinkedTable.jwc:
>
> <parameter name="dataSource" type="java.lang.String" required="yes"
> direction="in" />
>
> <parameter name="linkListener"
> type="org.apache.tapestry.IActionListener"
>     required="yes" direction="in" />
>
>
> <component id="link" type="DirectLink">
>    <binding name="listener" expression="linkListener" />
>    <binding name="parameters" expression="currentParameter" />
>    <binding name="disabled" expression= "currentDisabled" />
> </component>
>
> In my LinkedTable java I have an instance variable linkListener with
> getters and setters and I reset it to null in initialize.
>
> Any idea why I'm getting this error when my session has been inactive
> for a while?
>
> thanks in advance,
> Jonny
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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