-->
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.  [ 9 posts ] 
Author Message
 Post subject: PropertyAccessException: IllegalArgumentException
PostPosted: Tue Feb 05, 2008 6:34 am 
Newbie

Joined: Tue Feb 05, 2008 6:18 am
Posts: 8
Hello Folks,

I have the problem since several day I can not find a solution. Maybe you know about thist. I will be happy If you have some advices for me.

The Environment:
- WAS 6.0 / integriert in IBM RAD 6.1
- IBM DB2 Version 9.1

The Exception:
[05.02.08 11:14:24:176 CET] 00000022 SystemErr R org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of de.dcfs.quest.model.dataobjects.RVarRegions.actStatus
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:104)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337)
at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3566)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854)
at org.hibernate.loader.Loader.doQuery(Loader.java:729)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at de.dcfs.quest.model.daos.RVarRegionsDao.listRRegionsTransferByActStatus(RVarRegionsDao.java)
at de.dcfs.quest.it.database.regio.RegioDAO.readVarRegions(RegioDAO.java:250)
at de.dcfs.quest.bt.regio.ReadVarCompaniesTask.execute(ReadVarCompaniesTask.java:43)
at itmedia.lea.workflowengine.core.Task.startTaskExecutable(Task.java:92)
at itmedia.lea.workflowengine.core.Workflow.startTask(Workflow.java:1171)
at itmedia.lea.workflowengine.core.Workflow.processWFEvent(Workflow.java:463)
at itmedia.lea.workflowengine.core.Workflow.run(Workflow.java:985)
Caused by: java.lang.IllegalArgumentException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
... 22 more


hbm.xml-File:
<hibernate-mapping>
<class name="........RVarRegions" table="R_VAR_REGIONS" >
<id name="regionId" type="long">
<column name="REGION_ID" precision="11" scale="0" />
<generator class="increment" />
</id>
<many-to-one name="RVarRegions" class=".............RVarRegions" fetch="select">
<column name="PARENT_REGION_ID" precision="11" scale="0" />
</many-to-one>
<property name="name" type="string">
<column name="NAME" length="200" />
</property>
<property name="description" type="string">
<column name="DESCRIPTION" length="2000" />
</property>
<property name="actStatus" type="long">
<column name="ACT_STATUS" precision="22" scale="0" not-null="true" />
</property>
<property name="companyId" type="long">
<column name="COMPANY_ID" precision="22" scale="0" not-null="true" />
</property>
<set name="umSiteses" inverse="true">
<key>
<column name="R_VAR_REGION_ID" precision="10" scale="0" />
</key>
<one-to-many class="...................UmSites" />
</set>
<set name="siteUsersVarRegionses" inverse="true">
<key>
<column name="R_REGION_ID" precision="11" scale="0" not-null="true" />
</key>
<one-to-many class="..................SiteUsersVarRegions" />
</set>
<set name="RVarRegionses" inverse="true">
<key>
<column name="PARENT_REGION_ID" precision="11" scale="0" />
</key>
<one-to-many class="..............RVarRegions" />
</set>
</class>
</hibernate-mapping>


Java-File:
public class RVarRegions implements java.io.Serializable {
private Long regionId;
private RVarRegions RVarRegions;
private String name;
private String description;
private BigInteger actStatus;
private BigInteger companyId;
private Set umSiteses = new HashSet(0);
private Set siteUsersVarRegionses = new HashSet(0);
private Set RVarRegionses = new HashSet(0);

public RVarRegions() {
}

/** minimal constructor */
public RVarRegions(Long regionId, BigInteger actStatus,
BigInteger companyId) {
this.regionId = regionId;
this.actStatus = actStatus;
this.companyId = companyId;
}

/** full constructor */
public RVarRegions(Long regionId, RVarRegions RVarRegions,
String name, String description, BigInteger actStatus,
BigInteger companyId, Set umSiteses, Set siteUsersVarRegionses,
Set RVarRegionses) {
this.regionId = regionId;
this.RVarRegions = RVarRegions;
this.name = name;
this.description = description;
this.actStatus = actStatus;
this.companyId = companyId;
this.umSiteses = umSiteses;
this.siteUsersVarRegionses = siteUsersVarRegionses;
this.RVarRegionses = RVarRegionses;
}

// Property accessors
public Long getRegionId() {
return this.regionId;
}

public void setRegionId(Long regionId) {
this.regionId = regionId;
}

public RVarRegions getRVarRegions() {
return this.RVarRegions;
}

public void setRVarRegions(RVarRegions RVarRegions) {
this.RVarRegions = RVarRegions;
}

public String getName() {
return this.name;
}

public void setName(String name) {
this.name = name;
}

public String getDescription() {
return this.description;
}

public void setDescription(String description) {
this.description = description;
}

public BigInteger getActStatus() {
return this.actStatus;
}

public void setActStatus(BigInteger actStatus) {
this.actStatus = actStatus;
}

public BigInteger getCompanyId() {
return this.companyId;
}

public void setCompanyId(BigInteger companyId) {
this.companyId = companyId;
}

public Set getUmSiteses() {
return this.umSiteses;
}

public void setUmSiteses(Set umSiteses) {
this.umSiteses = umSiteses;
}

public Set getSiteUsersVarRegionses() {
return this.siteUsersVarRegionses;
}

public void setSiteUsersVarRegionses(Set siteUsersVarRegionses) {
this.siteUsersVarRegionses = siteUsersVarRegionses;
}

public Set getRVarRegionses() {
return this.RVarRegionses;
}

public void setRVarRegionses(Set RVarRegionses) {
this.RVarRegionses = RVarRegionses;
}

}



Thanks in advance

Regards,
Kafftarbaz


Top
 Profile  
 
 Post subject: Re: PropertyAccessException: IllegalArgumentException
PostPosted: Tue Feb 05, 2008 12:20 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
What if you change actStatus type to Long?


Farzad-


Top
 Profile  
 
 Post subject: Re: PropertyAccessException: IllegalArgumentException
PostPosted: Tue Feb 05, 2008 12:31 pm 
Newbie

Joined: Tue Feb 05, 2008 6:18 am
Posts: 8
Hi Farzad,

thanks for your advice! You mean like this:

public class RVarRegions implements java.io.Serializable {

private Long actStatus;
private Long companyId;

/** default constructor */
public RVarRegions() {
}

/** minimal constructor */
public RVarRegions(Long regionId, Long actStatus,
Long companyId) {
this.regionId = regionId;
this.actStatus = actStatus;
this.companyId = companyId;
}

/** full constructor */
public RVarRegions(Long regionId, RVarRegions RVarRegions,
String name, String description, Long actStatus,
Long companyId, Set umSiteses, Set siteUsersVarRegionses,
Set RVarRegionses) {
this.regionId = regionId;
this.RVarRegions = RVarRegions;
this.name = name;
this.description = description;
this.actStatus = actStatus;
this.companyId = companyId;
this.umSiteses = umSiteses;
this.siteUsersVarRegionses = siteUsersVarRegionses;
this.RVarRegionses = RVarRegionses;
}

public Long getActStatus() {
return this.actStatus;
}

public void setActStatus(Long actStatus) {
this.actStatus = actStatus;
}

public Long getCompanyId() {
return this.companyId;
}

public void setCompanyId(Long companyId) {
this.companyId = companyId;
}

}


I tried to go this way, but it doesnt work :-(


Top
 Profile  
 
 Post subject: Re: PropertyAccessException: IllegalArgumentException
PostPosted: Tue Feb 05, 2008 12:35 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
Can you give the whole stack trace? The problem happens when HB is trying to put the value back into your object. Since you are nothing doing much in the setter method I guess this is a problem with the types. Send me a full stack trace and we will see if there is any information in it.



Farzad-


Top
 Profile  
 
 Post subject: Re: PropertyAccessException: IllegalArgumentException
PostPosted: Tue Feb 05, 2008 12:44 pm 
Newbie

Joined: Tue Feb 05, 2008 6:18 am
Posts: 8
Soory, that is all what I can send you. I don not know where I can get more about the Stacktrace.


[05.02.08 17:38:54:009 CET] 00000020 SystemOut O Hibernate: select rcompanies0_.R_COMPANY_ID as R1_23_, rcompanies0_.NAME as NAME23_, rcompanies0_.DESCRIPTION as DESCRIPT3_23_, rcompanies0_.ACT_STATUS as ACT4_23_ from R_COMPANIES rcompanies0_
[05.02.08 17:38:54:079 CET] 00000020 SystemOut O Hibernate: select qprojects0_.Q_PROJECT_ID as Q1_16_, qprojects0_.R_COMPANY_ID as R2_16_, qprojects0_.NAME as NAME16_, qprojects0_.DESCRIPTION as DESCRIPT4_16_, qprojects0_.ACT_STATUS as ACT5_16_, qprojects0_.SHOW_QUEST_FROM as SHOW6_16_ from Q_PROJECTS qprojects0_ where qprojects0_.ACT_STATUS<>1
[05.02.08 17:38:54:109 CET] 00000020 SystemOut O Hibernate: select umsiteweig0_.UM_SITE_WEIGHT_ID as UM1_34_, umsiteweig0_.WEIGHTING_TYPE as WEIGHTING2_34_, umsiteweig0_.LOW as LOW34_, umsiteweig0_.HIGH as HIGH34_, umsiteweig0_.WEIGHT as WEIGHT34_ from UM_SITE_WEIGHTS umsiteweig0_ order by umsiteweig0_.WEIGHTING_TYPE, umsiteweig0_.LOW
[05.02.08 17:42:43:850 CET] 00000020 SystemOut O Hibernate: select rvarregion0_.REGION_ID as REGION1_28_, rvarregion0_.PARENT_REGION_ID as PARENT2_28_, rvarregion0_.NAME as NAME28_, rvarregion0_.DESCRIPTION as DESCRIPT4_28_, rvarregion0_.ACT_STATUS as ACT5_28_, rvarregion0_.COMPANY_ID as COMPANY6_28_ from R_VAR_REGIONS rvarregion0_ where rvarregion0_.ACT_STATUS<>1
[05.02.08 17:42:43:910 CET] 0000001d ServletWrappe I SRVE0242I: [questEAR] [/quest] [/jsps/regio/varRegio.jsp]: Initialisierung erfolgreich.
[05.02.08 17:42:43:890 CET] 00000020 SystemErr R org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of de.dcfs.quest.model.dataobjects.RVarRegions.actStatus
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:104)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337)
at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3566)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854)
at org.hibernate.loader.Loader.doQuery(Loader.java:729)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at de.dcfs.quest.model.daos.RVarRegionsDao.listRRegionsTransferByActStatus(RVarRegionsDao.java)
at de.dcfs.quest.it.database.regio.RegioDAO.readVarRegions(RegioDAO.java:250)
at de.dcfs.quest.bt.regio.ReadVarCompaniesTask.execute(ReadVarCompaniesTask.java:43)
at itmedia.lea.workflowengine.core.Task.startTaskExecutable(Task.java:92)
at itmedia.lea.workflowengine.core.Workflow.startTask(Workflow.java:1171)
at itmedia.lea.workflowengine.core.Workflow.processWFEvent(Workflow.java:463)
at itmedia.lea.workflowengine.core.Workflow.run(Workflow.java:985)
Caused by: java.lang.IllegalArgumentException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
... 22 more


Top
 Profile  
 
 Post subject: Re: PropertyAccessException: IllegalArgumentException
PostPosted: Tue Feb 05, 2008 1:22 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
check where you hibernate logs are going. The logs should actually tell you what type HB is expecting to see and what it is getting.

what is the db type for ACT_STATUS?


Farzad-


Top
 Profile  
 
 Post subject: Re: PropertyAccessException: IllegalArgumentException
PostPosted: Tue Feb 05, 2008 1:49 pm 
Newbie

Joined: Tue Feb 05, 2008 6:18 am
Posts: 8
Now the Log4J ist enabled and I can give you the following Infos:

[05.02.08 18:45:44:696 CET] 00000024 SystemOut O [ERROR,BasicPropertyAccessor,WF] IllegalArgumentException in class: de.dcfs.quest.model.dataobjects.RVarRegions, setter method of property: actStatus
X[ERROR,BasicPropertyAccessor,WF] IllegalArgumentException in class: de.dcfs.quest.model.dataobjects.RVarRegions, setter method of property: actStatus
X[ERROR,BasicPropertyAccessor,WF] expected type: java.lang.Long, actual value: java.math.BigDecimal
X[ERROR,BasicPropertyAccessor,WF] expected type: java.lang.Long, actual value: java.math.BigDecimal


This tell me, that I should change the datatypes. But I do that several times and I had no success.


This ist the DB-Table:
TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME IS_NULLABLE COLUMN_SIZE
R_VAR_REGIONS REGION_ID -5 BIGINT NO 19
R_VAR_REGIONS PARENT_REGION_ID -5 BIGINT YES 19
R_VAR_REGIONS NAME 12 VARCHAR YES 200
R_VAR_REGIONS DESCRIPTION 12 VARCHAR YES 2000
R_VAR_REGIONS ACT_STATUS -5 BIGINT NO 19
R_VAR_REGIONS COMPANY_ID -5 BIGINT NO 19


Now, I have to go! Sorry, I will continue tomorrow. Thanks a lot for your help. I will inform you about the result.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 05, 2008 3:53 pm 
Beginner
Beginner

Joined: Thu Dec 13, 2007 2:32 pm
Posts: 26
Hey,

Can you try after altering your mappings to java.lang.Long, instead of long in the type ?

( i noticed that your actStatus's type right now is type="long" )

that would solve the issue i think.

Let me know.

Regards
Vyas, Anirudh

_________________
Regards,
Vyas, Anirudh


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 7:06 am 
Newbie

Joined: Tue Feb 05, 2008 6:18 am
Posts: 8
Hello Folks,

thank a lot for your helps and advices:

The solution was:
A) I changed the HQL-Statement to:
result = session.createQuery("select rvr from RVarRegions rvr where actStatus <> 1 ").list();

B) I changed in the Java-File the datatype from java.lang.Long to java.math.BigDecimal:

public class RVarRegions implements java.io.Serializable {
private BigDecimal actStatus;
private BigDecimal companyId;

public BigDecimal getActStatus() {
return this.actStatus;
}

public void setActStatus(BigDecimal actStatus) {
this.actStatus = actStatus;
}

public BigDecimal getCompanyId() {
return this.companyId;
}

public void setCompanyId(BigDecimal companyId) {
this.companyId = companyId;
}
}

C) Also the database driver is now changed from "COM.ibm.db2.jdbc.app.DB2Driver" to "com.ibm.db2.jcc.DB2Driver"

D) Changes in the config file of hibernate hibernate.cfg.xml
<property name="hibernate.bytecode.use_reflection_optimizer">true</property>
...
<property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>


Thanks again for your helps & advices


Best Regards,
Kafftarbaz :-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 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.