mrfeng wrote:
org.hibernate.HibernateException: identifier of an instance of com.nbnh.enterprise.po.User altered from 4028809303f909db0103f909e0760001 to
This is a mind boggling error that I got too. And it had nothing to do with my code.
I was using save() to persist the object to the database but later on when the JSP got rendered, Webwork's tags tried to set the id of the object causing this error.
I found it by printing a stacktrace in the setId() method:
java.lang.Throwable
at com.zz.zz.vo.User.setId(User.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:491)
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:785)
at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:937)
at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:76)
at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
at com.opensymphony.xwork.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:63)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1629)
at ognl.ASTProperty.setValueBody(ASTProperty.java:105)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.ASTChain.setValueBody(ASTChain.java:172)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.Ognl.setValue(Ognl.java:476)
at com.opensymphony.xwork.util.OgnlUtil.setValue(OgnlUtil.java:184)
at com.opensymphony.xwork.util.OgnlValueStack.setValue(OgnlValueStack.java:153)
at com.opensymphony.xwork.util.OgnlValueStack.setValue(OgnlValueStack.java:136)
at com.opensymphony.xwork.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:136)
at com.opensymphony.xwork.interceptor.ParametersInterceptor.before(ParametersInterceptor.java:111)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:30)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
at com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:171)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
at com.opensymphony.xwork.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:151)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:189)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)