Hi,
I am getting following exception in JBoss 4.2.2 server:
Code:
2010-12-15 08:23:39,183 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] generated identifier: 1044, using strategy: org.hibernate.id.SequenceGenerator
2010-12-15 08:23:39,185 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] saving [com.adp.ebs.admin.crs.dvo.CRSAuditInfo#1044]
2010-12-15 08:23:39,188 ERROR [org.hibernate.property.BasicPropertyAccessor] IllegalArgumentException in class: com.adp.ebs.admin.crs.dvo.CRSAuditInfo, setter method of property: auditId
2010-12-15 08:23:39,188 ERROR [org.hibernate.property.BasicPropertyAccessor] expected type: java.lang.Integer, actual value: java.lang.Integer
2010-12-15 08:23:39,194 DEBUG [com.adp.sbs.struts.action.EBSExceptionHandler] **** EXCEPTION THROWN : org.hibernate.PropertyAccessException
2010-12-15 08:23:39,195 ERROR [com.adp.sbs.struts.action.EBSExceptionHandler] IllegalArgumentException occurred while calling setter of com.adp.ebs.admin.crs.dvo.CRSAuditInfo.auditId
org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.adp.ebs.admin.crs.dvo.CRSAuditInfo.auditId
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:104)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.setIdentifier(AbstractEntityTuplizer.java:211)
at org.hibernate.persister.entity.AbstractEntityPersister.setIdentifier(AbstractEntityPersister.java:3596)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:171)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
at com.adp.ebs.admin.services.crs.AuditServiceImpl.auditCRSMethod(AuditServiceImpl.java:26)
at com.adp.ebs.admin.services.crs.CRSServiceImpl.getQuestions(CRSServiceImpl.java:102)
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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
at com.adp.ebs.admin.interceptors.MethodTimer.profile(MethodTimer.java:19)
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 org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy63.getQuestions(Unknown Source)
at com.adp.ebs.admin.struts.action.login.POTDLogonAction.getChallengeQuestions(POTDLogonAction.java:1307)
at com.adp.ebs.admin.struts.action.login.POTDLogonAction.handleRegUser(POTDLogonAction.java:752)
at com.adp.ebs.admin.struts.action.login.POTDLogonAction.execute(POTDLogonAction.java:122)
at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:113)
at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:53)
at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:64)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:459)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.adp.ebs.sso.filter.XSSFilter.doFilter(XSSFilter.java:103)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.adp.sbs.filters.gzip.GZIPFilter.doFilter(GZIPFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
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 org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
... 75 more
Following is code and config files:
Code:
package com.adp.ebs.admin.crs.dvo;
public class CRSAuditInfo {
//private java.lang.Integer auditId;
private java.lang.Integer auditId = -1;
private java.sql.Timestamp createdDate;
private String crsMethod;
private String userId;
private String errorDesc;
private int statusCode;
/**
* No arg Constructor
*/
public CRSAuditInfo() {
}
/**
* @return the auditId
*/
public java.lang.Integer getAuditId() {
return auditId;
}
/**
* @param auditId the auditId to set
*/
public void setAuditId(java.lang.Integer auditId) {
this.auditId = auditId;
}
/**
* @return the createdDate
*/
public java.sql.Timestamp getCreatedDate() {
return createdDate;
}
/**
* @param createdDate the createdDate to set
*/
public void setCreatedDate(java.sql.Timestamp createdDate) {
this.createdDate = createdDate;
}
/**
* @return the crsMethod
*/
public String getCrsMethod() {
return crsMethod;
}
/**
* @param crsMethod the crsMethod to set
*/
public void setCrsMethod(String crsMethod) {
this.crsMethod = crsMethod;
}
/**
* @return the userId
*/
public String getUserId() {
return userId;
}
/**
* @param userId the userId to set
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* @return the errorDesc
*/
public String getErrorDesc() {
return errorDesc;
}
/**
* @param errorDesc the errorDesc to set
*/
public void setErrorDesc(String errorDesc) {
this.errorDesc = errorDesc;
}
/**
* @return the statusCode
*/
public int getStatusCode() {
return statusCode;
}
/**
* @param statusCode the statusCode to set
*/
public void setStatusCode(int statusCode) {
this.statusCode = statusCode;
}
}
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.adp.ebs.admin.crs.dvo">
<class name="CRSAuditInfo" table="CRS_AUDIT_INFO">
<id name="auditId" type="java.lang.Integer" >
<column name="AUDIT_ID"/>
<generator class="sequence">
<param name="sequence">crs_audit_id</param>
</generator>
</id>
<property name="createdDate" type="java.sql.Timestamp" column="CREATED_DATE"/>
<property name="crsMethod" type="java.lang.String" column="CRS_METHOD"/>
<property name="errorDesc" type="java.lang.String" column="ERROR_DESC"/>
<property name="statusCode" type="int" column="STATUS_CODE"/>
<property name="userId" type="java.lang.String" column="USER_ID"/>
</class>
</hibernate-mapping>
Code:
session.beginTransaction();
CRSAuditInfo crsAudit = new CRSAuditInfo();
crsAudit.setCrsMethod(method);
crsAudit.setErrorDesc(message);
crsAudit.setUserId(userId);
crsAudit.setStatusCode(SUCCESS_STATUS_CODE);
session.save(crsAudit);
session.getTransaction().commit();
I tested same classes/config using stand alone test program and they are working fine. But when i deploy same in jboss server, i am getting this problem.
I searched a lot in google and found lot of similar issues but somehow did not get solution.
Please help me.
Thanks