-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: IllegalArgumentException
PostPosted: Sat Apr 15, 2006 6:18 am 
Newbie

Joined: Sat Apr 15, 2006 6:02 am
Posts: 4
Hi,

I am getting the following error unexpectedly.Please tell me the reason for this error.The code was working fine ,but i dont know why it has suddenly.

The error is....

org.springframework.orm.hibernate3.HibernateSystemException: IllegalArgumentException occurred calling getter of com.fgy.accountsetup.plan.model.Plan.planId; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.fgy.accountsetup.plan.model.Plan.planId


Kindly replay for this.

With thanks

Sony


The stack trace is shown with 3 layers web->biz->dao->hibernate

com.fgy.common.services.exception.bizlayer.FGYBusinessException
at com.fgy.accountsetup.plan.biz.PlanImpl.createPlan(PlanImpl.java:337)
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:292)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at com.fgy.common.exceptionhandling.Interceptor.invoke(Interceptor.java:37)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy8.createPlan(Unknown Source)
at com.fgy.accountsetup.plan.web.action.PersistPlanParametersAction.createPlan(PersistPlanParametersAction.java:233)
at com.fgy.accountsetup.plan.web.action.PersistPlanParametersAction.processRequest(PersistPlanParametersAction.java:170)
at com.fgy.common.web.BaseAction.execute(BaseAction.java:257)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.fgy.common.web.FGYFilter.doFilter(FGYFilter.java:55)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: com.fgy.common.services.exception.datalayer.FGYDataAccessException
at com.fgy.common.services.exception.datalayer.FGYDataAccessException.mapAndThrowAsDataAccessException(FGYDataAccessException.java:146)
at com.fgy.accountsetup.plan.dao.PlanDAOImpl.createPlan(PlanDAOImpl.java:173)
at com.fgy.accountsetup.plan.biz.PlanImpl.createPlan(PlanImpl.java:314)
... 40 more
Caused by: org.springframework.orm.hibernate3.HibernateSystemException: IllegalArgumentException occurred calling getter of com.fgy.accountsetup.plan.model.Plan.planId; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.fgy.accountsetup.plan.model.Plan.planId
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:656)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:413)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:320)
at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:627)
at com.fgy.accountsetup.plan.dao.PlanDAOImpl.createPlan(PlanDAOImpl.java:169)
... 41 more
Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.fgy.accountsetup.plan.model.Plan.planId
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:119)
at org.hibernate.tuple.AbstractTuplizer.getIdentifier(AbstractTuplizer.java:103)
at org.hibernate.persister.entity.BasicEntityPersister.getIdentifier(BasicEntityPersister.java:2944)
at org.hibernate.persister.entity.BasicEntityPersister.isTransient(BasicEntityPersister.java:2705)
at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:181)
at org.hibernate.event.def.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:409)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:82)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:468)
at org.hibernate.engine.Cascades$5.cascade(Cascades.java:154)
at org.hibernate.engine.Cascades.cascadeAssociation(Cascades.java:771)
at org.hibernate.engine.Cascades.cascade(Cascades.java:720)
at org.hibernate.engine.Cascades.cascade(Cascades.java:847)
at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:332)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:214)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:160)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:96)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:468)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:463)
at org.springframework.orm.hibernate3.HibernateTemplate$18.doInHibernate(HibernateTemplate.java:630)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:315)
... 43 more
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$BasicGetter.get(BasicPropertyAccessor.java:105)
... 67 more


Top
 Profile  
 
 Post subject: IllegalArgumentException... Problem solved
PostPosted: Sun Apr 16, 2006 2:18 am 
Newbie

Joined: Sat Apr 15, 2006 6:02 am
Posts: 4
Hi,

I solved this problem by renaming a method in POJO.The problem was not a consistent one,it happens sometimes.

My earlier contents of 'Plan' class was like
public class Plan
{

private Plan currentPlan;
......
......

public Plan getCurrentPlan()
{
return currentPlan;
}

public void setCurrentPlan(Plan currentPlan)
{
this.currentPlan = currentPlan;
}

public boolean isCurrentPlan()
{
if(<...>)
{
return true;
}
else
{
return false;
}
}
}



Now i changed the isCurrentPlan() to isThisCurrentPlan() and now it works fine.


I think the method signature 'isCurrentPlan()' makes some problem when used by Java reflection inside Hibernate code.

When i debugged inside Hibernate source i found that sometimes the object Boolean is passed in the below mentioned line as Entity(??)...

org.hibernate.tuple.AbstractTuplizer.getIdentifier(AbstractTuplizer.java:103)

Anybody who knows this aspect please reply...


With thanks
Sony M


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 16, 2006 4:40 am 
Senior
Senior

Joined: Tue Aug 23, 2005 8:52 am
Posts: 181
Since both "get" and "is" are valid values of getting values from a JavaBean, Renaming the isCurrentPlan to isThisCurrentPlan seems to solve the problem. Im not sure if Class.getDeclaredMethods() is supposed to return the same set of methods in the *same* order, but if thats not the case, that answers your part about "issue happening sometimes".


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.