Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Impossible to retrieve entity

 
Vitaliy Kravchenko
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem, with retrieving entity, I'm using Spring MVC + Hibernate.
I have a DAO layer

mapping....


Spring MVC controller


and I have got an error

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.orm.hibernate3.HibernateSystemException: identifier of an instance of jtforum.entites.Rank was altered from 1 to 1; nested exception is org.hibernate.HibernateException: identifier of an instance of jtforum.entites.Rank was altered from 1 to 1
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

org.springframework.orm.hibernate3.HibernateSystemException: identifier of an instance of jtforum.entites.Rank was altered from 1 to 1; nested exception is org.hibernate.HibernateException: identifier of an instance of jtforum.entites.Rank was altered from 1 to 1
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:679)
org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:912)
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:904)
jtforum.dao.RankDAO.getAllRank(RankDAO.java:21)
ru.jt.forum.web.controller.RegistrationController.populateRank(RegistrationController.java:53)

I don't know what to do, for the first glance everything is ok,thanks
P.s. sorry for my English
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic