You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Scott Jarvi <sc...@gmail.com> on 2005/10/12 16:53:32 UTC

NPE when using persist="client" and ServiceLink

Hi,

I have a page that's using the 'client' persistence strategy for one of its
properties. The page template includes a ServiceLink that triggers our own
subclass of RestartService. Our service logs the user out, invalidates the
session and then tries to redirect the user back to the 'Home' page, using
HomeService.getLink(). However, trying to get the link from the HomeService
resulted in a NPE...

org.apache.tapestry.record.PageClientPropertyPersistenceScope.shouldEncodeState
(PageClientPropertyPersistenceScope.java:45)
$ClientPropertyPersistenceScope_106dad08dcb.shouldEncodeState($ClientPropertyPersistenceScope_106dad08dcb.java)
org.apache.tapestry.record.ClientPropertyPersistenceStrategy.addParametersForPersistentProperties
(ClientPropertyPersistenceStrategy.java:136)
$PropertyPersistenceStrategy_106dad08dc7.addParametersForPersistentProperties($PropertyPersistenceStrategy_106dad08dc7.java)
$PropertyPersistenceStrategy_106dad08dc8.addParametersForPersistentProperties($PropertyPersistenceStrategy_106dad08dc8.java)
org.apache.tapestry.record.PropertyPersistenceStrategySourceImpl.addParametersForPersistentProperties
(PropertyPersistenceStrategySourceImpl.java:99)
$PropertyPersistenceStrategySource_106dad08d18.addParametersForPersistentProperties($PropertyPersistenceStrategySource_106dad08d18.java)
org.apache.tapestry.services.impl.LinkFactoryImpl.constructLink(
LinkFactoryImpl.java:112)
$LinkFactory_106dad08ca2.constructLink($LinkFactory_106dad08ca2.java)
org.apache.tapestry.engine.HomeService.getLink(HomeService.java:58)
(rest of stack trace omitted)

It seems that the NullPointer is caused by a null IPage in the RequestCycle,
which PageClientPropertyPersistenceScope tries to check to determine if
encoding should be applied.


Am I doing something out of the ordinary here? What could be causing the
RequestCycle's page to be null?

Any advice would be greatly appreciated.

Thanks,
Scott

Re: NPE when using persist="client" and ServiceLink

Posted by Howard Lewis Ship <hl...@gmail.com>.
Please add a bug to JIRA.

On 10/12/05, Scott Jarvi <sc...@gmail.com> wrote:
> Hi,
>
> I have a page that's using the 'client' persistence strategy for one of its
> properties. The page template includes a ServiceLink that triggers our own
> subclass of RestartService. Our service logs the user out, invalidates the
> session and then tries to redirect the user back to the 'Home' page, using
> HomeService.getLink(). However, trying to get the link from the HomeService
> resulted in a NPE...
>
> org.apache.tapestry.record.PageClientPropertyPersistenceScope.shouldEncodeState
> (PageClientPropertyPersistenceScope.java:45)
> $ClientPropertyPersistenceScope_106dad08dcb.shouldEncodeState($ClientPropertyPersistenceScope_106dad08dcb.java)
> org.apache.tapestry.record.ClientPropertyPersistenceStrategy.addParametersForPersistentProperties
> (ClientPropertyPersistenceStrategy.java:136)
> $PropertyPersistenceStrategy_106dad08dc7.addParametersForPersistentProperties($PropertyPersistenceStrategy_106dad08dc7.java)
> $PropertyPersistenceStrategy_106dad08dc8.addParametersForPersistentProperties($PropertyPersistenceStrategy_106dad08dc8.java)
> org.apache.tapestry.record.PropertyPersistenceStrategySourceImpl.addParametersForPersistentProperties
> (PropertyPersistenceStrategySourceImpl.java:99)
> $PropertyPersistenceStrategySource_106dad08d18.addParametersForPersistentProperties($PropertyPersistenceStrategySource_106dad08d18.java)
> org.apache.tapestry.services.impl.LinkFactoryImpl.constructLink(
> LinkFactoryImpl.java:112)
> $LinkFactory_106dad08ca2.constructLink($LinkFactory_106dad08ca2.java)
> org.apache.tapestry.engine.HomeService.getLink(HomeService.java:58)
> (rest of stack trace omitted)
>
> It seems that the NullPointer is caused by a null IPage in the RequestCycle,
> which PageClientPropertyPersistenceScope tries to check to determine if
> encoding should be applied.
>
>
> Am I doing something out of the ordinary here? What could be causing the
> RequestCycle's page to be null?
>
> Any advice would be greatly appreciated.
>
> Thanks,
> Scott
>
>


--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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