My grid data required a model. In copying this in from an example I had:

@SuppressWarnings("unchecked")
        @Property
        @Retain
        private BeanModel _myModel;

The key here is @Retain. This works fine until there is a timeout (default 10 mins) and the page is returned to the pool whereupon it becomes null and thus causes Grid to fall over when it attempts to render. Changing Retain to Persist cured the problem. That's rather a nasty gotcha.

QUESTION
--------

Currently I am creating my model in initialisePage(). If I were to contnue to use @Retain rather than @Persist, where should I be initialising my model?

thanks,
p.


Quoting tapestryphoto <pho...@digiatlas.org>:

Further investigation reveals this is happening due to the page timing
out and being returned to the pool by the timeout specified by the
configuration option:

tapestry.page-pool.active-window

(which defaults to 10 minutes)

So it would appear that it's being reset when returned to the pool.
Unfortunately I'm not very knowledgable about this - even after
reading the relevant info on page lifecycles. Can someone please shed
some light on this?

p.


Quoting tapestryphoto <pho...@digiatlas.org>:


Hi!

I have a form and a grid component on one of my pages (the grid is
outside the form). All operates normally (using Jetty) unless I leave
it for 10 minutes. If I then attempt to perform a submit I get the
Null Pointer Exception listed below. It only happens on pages with the
grid component.  My Jetty session timeout (in webdefault.xml) is set
to 30 minutes.

I'm not quite sure how to proceed in tracking the problem down as the
error is taking place in Grid. The ten minutes suggests a timeout -
but where?

Help appreciated.

Thanks,
p.


java.lang.NullPointerException

Stack trace

       *
org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java:112)
       *
org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java)
       *
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$13$1.run(ComponentPageElementImpl.java:495)
       *
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:917)
       *
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$200(ComponentPageElementImpl.java:50)
       *
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$13.render(ComponentPageElementImpl.java:499)
       *
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72)
       *
org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121)
       *
org.apache.tapestry5.services.TapestryModule$19.renderMarkup(TapestryModule.java:1200)
       *
org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1580)
       *
org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1561)
       *
org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1543)
       *
org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1525)
       *
org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1495)
       *
org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64)
       *
org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:57)
       *
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:59)
       *
org.apache.tapestry5.services.TapestryModule$35.handle(TapestryModule.java:1779)
       *
org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:92)
       *
org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:71)
       *
org.apache.tapestry5.services.TapestryModule$17.service(TapestryModule.java:1029)


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




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




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

Reply via email to