You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by nhhockeyplayer nashua <nh...@hotmail.com> on 2013/01/03 13:41:32 UTC

why is homePage null ? after long time and possibly session timeout

Folks,

I have a component... that uses the folllwing link handler

    @InjectPage("Home")
    private Home homePage;

    public Object onIndividualPage(int pageNum)
    {
        logger.info("In onPage : ");

        cursor = ((pageNum-1) * itemsPerPage);
        return homePage;
    }

Ok I run my tap5 app... but then I take off to go do my workouts... come back 90 minutes later... and I attempt to run my app again...

so I click on one of my link handlers

homePage is null and app goes down with NPE

I dont want to infest my whole app with null checks

can anyone explain whats going on?

Best regards 
and thanks... KEN 		 	   		  

Re: why is homePage null ? after long time and possibly session timeout

Posted by Cezary Biernacki <ce...@gmail.com>.
I am pretty sure that homePage is not null and/or
your code excerpt is not enough to explain NPEs that you are .

I would recommend that you should first try to investigate
your problems using tools like debugger or application logging.

Have you spent at least an hour trying to solve this problem?
If not, you are just asking us doing your homework.

Do you know what exactly line triggers exception and what
are values all your variables?
If not, you are programming by 'superstitions' instead of facts.

Do you know which fields are stored in a user session,
and how your code would behave if the session expires?
If not, you need to improve of your understanding how web applications
work,
and how Java and Tapestry handle state in user sessions.


Best regards,
Cezary




On Thu, Jan 3, 2013 at 1:41 PM, nhhockeyplayer nashua <
nhhockeyplayer@hotmail.com> wrote:

>
> Folks,
>
> I have a component... that uses the folllwing link handler
>
>     @InjectPage("Home")
>     private Home homePage;
>
>     public Object onIndividualPage(int pageNum)
>     {
>         logger.info("In onPage : ");
>
>         cursor = ((pageNum-1) * itemsPerPage);
>         return homePage;
>     }
>
> Ok I run my tap5 app... but then I take off to go do my workouts... come
> back 90 minutes later... and I attempt to run my app again...
>
> so I click on one of my link handlers
>
> homePage is null and app goes down with NPE
>
> I dont want to infest my whole app with null checks
>
> can anyone explain whats going on?
>
> Best regards
> and thanks... KEN

Re: why is homePage null ? after long time and possibly session timeout

Posted by Chris Poulsen <ma...@nesluop.dk>.
Your web container could.

-- 
Chris


On Thu, Jan 3, 2013 at 3:24 PM, nhhockeyplayer nashua <
nhhockeyplayer@hotmail.com> wrote:

>
> Could shiro be invalidating the session on me?
>
>
>
> From: nhhockeyplayer@hotmail.com
> To: users@tapestry.apache.org
> Subject: why is homePage null  ? after long time and possibly session
> timeout
> Date: Thu, 3 Jan 2013 07:41:32 -0500
>
>
>
>
>
> Folks,
>
> I have a component... that uses the folllwing link handler
>
>     @InjectPage("Home")
>     private Home homePage;
>
>     public Object onIndividualPage(int pageNum)
>     {
>         logger.info("In onPage : ");
>
>         cursor = ((pageNum-1) * itemsPerPage);
>         return homePage;
>     }
>
> Ok I run my tap5 app... but then I take off to go do my workouts... come
> back 90 minutes later... and I attempt to run my app again...
>
> so I click on one of my link handlers
>
> homePage is null and app goes down with NPE
>
> I dont want to infest my whole app with null checks
>
> can anyone explain whats going on?
>
> Best regards
> and thanks... KEN
>
>

RE: why is homePage null ? after long time and possibly session timeout

Posted by nhhockeyplayer nashua <nh...@hotmail.com>.
Could shiro be invalidating the session on me?



From: nhhockeyplayer@hotmail.com
To: users@tapestry.apache.org
Subject: why is homePage null  ? after long time and possibly session timeout
Date: Thu, 3 Jan 2013 07:41:32 -0500





Folks,

I have a component... that uses the folllwing link handler

    @InjectPage("Home")
    private Home homePage;

    public Object onIndividualPage(int pageNum)
    {
        logger.info("In onPage : ");

        cursor = ((pageNum-1) * itemsPerPage);
        return homePage;
    }

Ok I run my tap5 app... but then I take off to go do my workouts... come back 90 minutes later... and I attempt to run my app again...

so I click on one of my link handlers

homePage is null and app goes down with NPE

I dont want to infest my whole app with null checks

can anyone explain whats going on?

Best regards 
and thanks... KEN