-->
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.  [ 1 post ] 
Author Message
 Post subject: org.hibernate.PropertyAccessException: IllegalArgumentExcept
PostPosted: Wed Sep 17, 2014 11:18 am 
Newbie

Joined: Wed Sep 17, 2014 11:05 am
Posts: 1
Hi All,

Please help us regarding below issue

We are using hibernate3.jar and all mapping files and entity classes looks fine but still we are getting the below exception

org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.entity.GroupParent.parent
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)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Please find the below mapping file and entity class

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping>

<class name="GroupParent"
table="TROUBLE_GROUP"
schema="TEST" dynamic-insert="true" dynamic-update="true">

<id
name="id"
type="java.lang.Long"
column="ID">
<generator class="sequence">
<param name="sequence">TROUBLE_GROUP_SEQ</param>
</generator>
</id>

<property
name="version"
type="java.lang.Long"
column="VERSION"
length="16"/>

<property
name="ticketNumber"
type="java.lang.String"
column="TICKET_NUMBER"
not-null="true"
length="25"/>
<----------------- SO ON ------ WE HAVE OTHER MAPPINGS>
<many-to-one name="parent"
class="GroupParent"
column="PARENT_ID" not-null="false" lazy="false"/>
</class>
</hibernate-mapping>
----------------------------------------------------------------------------------------------------
ENTITY Class:
GroupParent.java
------------------
public class GroupParent implements Group {

private Group parent;
void setParentId(Long parentId) {
this.parentId = parentId;
}

}

==================================

the answer for the above issue is we have changed the field name from name="parent" to name = "par" . We didnt know why hibernate is behaving like this???? may be parent field name willnot be allowed by hibernate??


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

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.