I am getting a Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: gov.michigan.mdch.ibs.domain.Users.userRoleses, no session or session was closed. I am using JQUERY for my Ajax to call the controller. The Controler will pass back a JSON object to be render in a div tag on the JSP I know the user bean I am trying to return has 2 children tables. I have included the user bean and the DAO. I have tried the OpenSessionInViewFilter in the web.xml and that is not working. I just wanted to know if you had any ideas.
Thanks Todd
Controller @RequestMapping(value = "/adminSearch", method = RequestMethod.POST) public @ResponseBody List getSearchResults( @RequestParam(value = "id", required = true) String id, @RequestParam(value = "fstname", required = true) String fstname, @RequestParam(value = "lstname", required = true) String lstname, Model model) { //display the printed values System.out.println(); System.out.println("username = " + id); System.out.println("firstname = " + fstname); System.out.println("lastname = " + lstname); List users; HibernateSessionFactory.getSession(); users= usersService.findAllUserss(-1, -1); Hibernate.initialize(users); System.out.println("Here is the size "+users.size()); for(Users user:users){ System.out.println(user.getFirstName()); } return users;