You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mike Leonardo <mi...@ifactory.com> on 2008/04/10 17:42:53 UTC

T4: Issue with Hibernate Session closes on Custom 404 page render

Hey,

I have a Custom 404 page that uses the hibernate session to render part of the page. If I visit the page explicitly it works fine, but if I set it as the 404 page in web.xml then it throws an exception that the session is closed:

org.hibernate.LazyInitializationException : failed to lazily initialize a collection of role: com.ifactory.cms.entities.StandardPage.children, no session or session was closed

Here is how I set it in the web.xml:

<error-page>
     <error-code>404</error-code>
    <location>/app?service=page&amp;page=main/Custom404</location>
</error-page>

Any thoughts?
Thanks!

- Mike Leonardo

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


Re: T4: Issue with Hibernate Session closes on Custom 404 page render

Posted by Alejandro Scandroli <al...@gmail.com>.
Hi Mike

How are you openning your sessions?
OSIV Filter perhaps? If yes, does the filter pattern match your 404 url?


--
Alejandro Scandroli - http://weblog.amneris.es/
Amneris: We build process-driven web applications.
http://www.amneris.es


On Thu, Apr 10, 2008 at 5:42 PM, Mike Leonardo <mi...@ifactory.com> wrote:
> Hey,
>
>  I have a Custom 404 page that uses the hibernate session to render part of the page. If I visit the page explicitly it works fine, but if I set it as the 404 page in web.xml then it throws an exception that the session is closed:
>
>  org.hibernate.LazyInitializationException : failed to lazily initialize a collection of role: com.ifactory.cms.entities.StandardPage.children, no session or session was closed
>
>  Here is how I set it in the web.xml:
>
>  <error-page>
>      <error-code>404</error-code>
>     <location>/app?service=page&amp;page=main/Custom404</location>
>  </error-page>
>
>  Any thoughts?
>  Thanks!
>
>  - Mike Leonardo
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>  For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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