Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6174757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:48:18+00:00 2026-05-23T23:48:18+00:00

I have JSF 2.1 application uisng Spring and Hibernate. In order to solve LazyLoading

  • 0

I have JSF 2.1 application uisng Spring and Hibernate.

In order to solve LazyLoading problem I’m using OpenSessionInView Filter.

<filter>
    <filter-name>openSessionInViewFilter</filter-name>
    <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
 <filter-mapping>
    <filter-name>openSessionInViewFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

Everything works fine my lazy classes are initiated, but when I’m using Navigation Rule with Redirect

 <navigation-rule>
   <from-view-id>/index.xhtml</from-view-id>
   <navigation-case>
       <from-outcome>fail</from-outcome>
       <to-view-id>/index.xhtml</to-view-id>
       <redirect />
   </navigation-case>
</navigation-rule>

I’m getting org.hibernate.LazyInitializationException: id I remove <redirect /> tag everything works fine.

Why? Is it because new View has been created? So why do I have new Hibernate Session?
Is there any work around?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:48:19+00:00Added an answer on May 23, 2026 at 11:48 pm

    <redirect /> is implemented by returning 301 (or 303) response code to the browser, thereby completing current request and closing your current (Hibernate) session.

    Browser then submits a new request to the URL provided, resulting in brand new (Hibernate) session which your not-yet-initialized entities are not bound to.

    You will either need to manually trigger initialization in existing request prior to redirect (if possible) or re-fetch all the necessary entities again after the redirect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have web application wich uses jsf 2.0 and spring 3.0 The problem is
I`m developing an application using Spring WebFlow 2, Facelets and JSF. One of my
i have a JSF web application. I use Beans as Spring Beans (not JSF
I am using spring,JPA,jsf for my application and webserver is tomcat.In my application i
I'm developing a web application using Java EE6 and JSF 2.0. I have a
In JSF is it possible to have a datatable displays records as follows? [Name
Is there any documentation about introducing jBoss seam to an old Hibernate/JSF project? Have
I am working on a CRUD application using .NET and I have about 10
We have a JSF web application that uses Acegi security. We also have a
I am developing an application using JSF in Eclipse IDE with Derby as database.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.