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

Joined: Tue Feb 05, 2008 6:18 am
Posts: 8
Hallo Zusammen,

ich habe seit längerem das folgende Problem, den ich nicht gelöst bekomme. Vielleicht kennt einer von Euch sich besser aus. Wäre Ihn/Ihr sehr dankbar für einen Ratschlag/Tipp.

Folgende Laufzeitumgebung habe ich:
- WAS 6.0 / integriert in IBM RAD 6.1
- IBM DB2 Version 9.1

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;
}

}



Danke im Voraus!


Grüße,
Kafftarbaz


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 05, 2008 6:20 pm 
Newbie

Joined: Fri Nov 30, 2007 7:44 am
Posts: 7
ich hab zwar noch nie in JAVA programmiert aber auffällig ist das im mapping file name="actStatus" type="long" ist in im setter BigInteger.
kommt denn die exeption auch wenn

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

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

ist ?

_________________
Kind regards
Uwe Lesta


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 7:03 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  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 7:04 am 
Newbie

Joined: Tue Feb 05, 2008 6:18 am
Posts: 8
Lesta wrote:
ich hab zwar noch nie in JAVA programmiert aber auffällig ist das im mapping file name="actStatus" type="long" ist in im setter BigInteger.
kommt denn die exeption auch wenn

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

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

ist ?


Hallo Uwe Lesta,

Infor für Dich: Nein, ich habe den hbm.xml file nicht angepasst. Da steht weiterhin long als Typ!


Grüße,
Kafftarbaz


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