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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:11:19+00:00 2026-06-07T21:11:19+00:00

I have the following Spring MVC controller that uses both a repository and an

  • 0

I have the following Spring MVC controller that uses both a repository and an active record. I systematically get the following exception:

Caused by: javax.persistence.EntityNotFoundException: Unable to find trc.suivi.domain.Destinataire with id 892
    at org.hibernate.ejb.Ejb3Configuration$Ejb3EntityNotFoundDelegate.handleEntityNotFound(Ejb3Configuration.java:137)
    at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:233)
    at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
    at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
    at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)
    at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1038)
    at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:630)
    at org.hibernate.type.EntityType.resolve(EntityType.java:438)
    at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:139)
    at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:982)
    at org.hibernate.loader.Loader.doQuery(Loader.java:857)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
    at org.hibernate.loader.Loader.doList(Loader.java:2542)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
    at org.hibernate.loader.Loader.list(Loader.java:2271)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:459)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:365)
    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:246)
    ... 78 more

Note that the line does exists in database!!

Here is my controller code:

@RequestMapping("/plis")
@Controller
@RooWebScaffold(path = "plis", formBackingObject = Pli.class)
@RooWebFinder
public class PliController {

    @Autowired
    private PliRepository pliRepository;

    @RequestMapping(params = { "find=ByMultiField", "form" }, method = RequestMethod.GET)
    public String findPlisByMultiFieldForm(Model uiModel) {
        populateMultiFieldForm(uiModel);
        return "plis/findPlisByMultiField";
    }

    @RequestMapping(params = "find=ByMultiField", method = RequestMethod.GET)
    public String findPlisByMultiField(@RequestParam("identifiant") String identifiant, Model uiModel) {
        uiModel.addAttribute("plis", pliRepository.findPlisByMultiFieldQuery(identifiant, null, false, false, null, false, null, null).getResultList());//REPOSITORY USAGE
        return "plis/list";
    }

    void populateMultiFieldForm(Model uiModel) {
        uiModel.addAttribute("pli_datereception_date_format", DateTimeFormat.patternForStyle("M-", LocaleContextHolder.getLocale()));
        uiModel.addAttribute("conteneurnums", ConteneurNum.findAllConteneurNums());//ACTIVE RECORD USAGE
        uiModel.addAttribute("statutplis", Arrays.asList(StatutPli.values()));
    }
}
  • 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-06-07T21:11:21+00:00Added an answer on June 7, 2026 at 9:11 pm

    Short answer is yes: Repository and ActiveRecord can coexist. My problem was probably due to some version issue.

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

Sidebar

Related Questions

I'm writing my Exception Handler from Spring MVC controller and I have the following
I have configured in following way that spring MVC app using Spring 3.1.1.RELEASE web.xml
I have a Spring MVC controller with an action that's called using AJAX. @SessionAttributes({userContext})
I have a portlet that uses spring mvc and when the portal is in
I have a Spring MVC Controller class that needs a property set from a
I have a Spring-Batch job that I launch from a Spring MVC controller. The
I have an MVC view page that uses a master page. The master page
I can't seem to get basic validation working with Spring MVC. I have the
I have a Spring MVC based Web Application with Hibernate. Following is the directory
I have an application that uses Spring Security to control access to pages, to

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.