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 6773403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:39:51+00:00 2026-05-26T15:39:51+00:00

Domain Description I am using a combination of Spring + Hibernate + Tuckey Urlrewrite

  • 0

Domain Description

I am using a combination of
Spring + Hibernate + Tuckey Urlrewrite
In a Spring Framework Web app.

I have a simple data strucutre
Special has 1:Many Image object

I am using the language in the url:
http://site.com/en/someview or
http://site.com/de/someview and so on
There is also a default url:
http://site.com/

I am using Tucky Urlrewrite to rewrite the urls from
http://site.com/en/someview to
http://site.com/someview?lang=en
in order select the correct language for the page
(I am doing this to allow the user to simply change the language in the url and have the site change language accordingly)

I am loading the Special object in the Default controller
I am passing the Special object to the view and loading the Images there.

Problem Description

When hitting http://site.com/ everything works as expected. Looking at the logs for Turkey it is NOT doing any rewrite.

When hitting http://site.com/en/ or http://site.com/de/ i am getting the dreaded
“failed to lazily initialize a collection of role“

I can prove that there is something with Tuckey Urlrewrite because when i enter the “rewritten” urls into the address bar they work and even removing Tuckey Urlrewrite all together.

I have tried the following

  • Loading the Images in the controller – did not work
  • Using the OpenEntityManagerInViewInterceptor — did not work
  • Using Tuckey’s dispatcher REQUEST/FORWARD — did not work
  • Using Tuckey’s type=”redirect” — did work but as expected redirected the browser
  • Used the OneToMany attribute’s fetch=FetchType.EAGER — worked (but in the long term not desirable)

I am open to all suggestions to remove the use of the FetchType.EAGER.

Some ideas i have are
– Different method of Url rewriting i.e. if it is possiable to set tomcat to handle the rewrite before the DispachFilter
– Different urlrewriter i.e. different product, or internal Spring URL Rewriter

Sites i have read

  • Why Doesn't Tuckey UrlRewrite Filter call chain.doFilter after a rule is matched?
  • Hibernate lazy initialization exception (most promissing but nothing there worked)
  • Hibernate (JPA) how to do an eager query, loading all child objects (finally to give up and use EAGER)

Really would be very thankful for any hints

Adam

  • 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-26T15:39:52+00:00Added an answer on May 26, 2026 at 3:39 pm

    If you use OpenSessionInViewFilter/OpenEntityManagerInViewFilter, make sure that one of the following is true:

    • <filter-mapping> of Open...InViewFilter is declared before <filter-mapping> of the Tuckey filter

    • <filter-mapping> of Open...InViewFilter contains <dispatcher>FORWARD</dispatcher>.

    Otherwise your Open...InViewFilter won’t be invoked, because Tuckey filter performs a forward when rewriting a URL, therefore filters declared after it should have <dispatcher>FORWARD</dispatcher> in order to be invoked.

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

Sidebar

Related Questions

I'm writing an application using the Spring Framework. Description of Exercise: Write a program
I have a simple Rails 3.1.rc6 app that I'm using to try to test
We have a simple domain model: Contact, TelephoneNumber and ContactRepository. Contact is entity, it
I have this following simple service program: using System.Diagnostics; using System.ServiceProcess; namespace BasicService {
I have a Grails project that is using Hibernate XML. The Hibernate file are
I have built a simple survey-tool using MVC 3 with only 1 layer (MVC).
I have a service to download file using credential domain\user but get this error
How do i update a domain object with ViewModel with AutoMapper using Entity framework?
hey , I have a problem with updating a record using a domain service,
I have a WCF service using BasicHttpBinding with Windows authentication. Most clients are domain

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.