Hibernate version:3.2.6.ga
Mapping documents:<hibernate-mapping package="com.cme.cphone.model.config"> <class name="Contact" table="SP_CONTACT_LIST_DETAIL"> <id name="contactId" type="int" column="ID"> <generator class="sequence"> <param name="sequence">CONTACT_LIST_DETAIL_SEQ</param> </generator> </id> <property name="firstName" type="string" column="FIRST_NAME" /> ... other properties omitted. </class> </hibernate-mapping>
Full stack trace of any exception that occurs: org.springframework.orm.hibernate3.HibernateSystemException: IllegalArgumentException occurred calling getter of com.cme.cphone.model.config.ModelClass.id; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.cme.cphone.model.config.ModelClass.id at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:661) at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:738) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:614) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy33.saveUserOptions(Lcom.cme.cphone.model.config.UserOptions;)V(Unknown Source) at com.cme.cphone.controller.UserOptionsUpdateController.handleRequest(UserOptionsUpdateController.java:17) at com.cme.cphone.base.BasicController.handleRequest(BasicController.java:37) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:523) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:463) at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283) Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.cme.cphone.model.config.ModelClass.id at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:171) at org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:183) at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:3596) at org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:3312) at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:181) at org.hibernate.event.def.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:512) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:80) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499) at org.hibernate.engine.CascadingAction$5.cascade(CascadingAction.java:218) at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268) at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216) at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169) at org.hibernate.engine.Cascade.cascade(Cascade.java:130) at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131) at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:606) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy33.saveUserOptions(Lcom.cme.cphone.model.config.UserOptions;)V(Unknown Source) at com.cme.cphone.controller.UserOptionsUpdateController.handleRequest(UserOptionsUpdateController.java:17) at com.cme.cphone.base.BasicController.handleRequest(BasicController.java:37)
Name and version of the database you are using:Oracle 9i
Based on the stack trace, I have no way of knowing which entity is causing the problem. I am updating a fairly sizable object graph without calling either save/saveOrUpdate.
I have a base class called ModelClass from which all classes inherit basic properties which are present in most tables. One of the properties is called id(getId() and setId()). id is a String(legacy database). This one table whose mapping I have given above has an ID column which is an int. I have therefore included a property called contactId in this class which is an int. The id property continues to exist in the class via inheritance. There is no table to which Model is mapped.
The code seems to work fine when I run it on Windows based WebLogic. After moving the code to Linux based WebLogic, I started getting the above error.
The above table used to have the ID column as a varchar2. It was recently changed to an integer. The WebLogic server has been bounced after the change.
Can someone point out what I am doing wrong. Let me know if you need additional code.
|