Show Some Love
JAVA

Hibernate : org.hibernate.PropertyAccessException: IllegalArgumentException

This forum was posted on Saturday, May 25, 2013 7:47:07 PM


I hv a parent table (MHS_USER) and associated child table (GROUP) mapped with ManyToMany relation as below (the related code snippet following)

@Entity
@Table(name = "mhs_user")
public class MHSUser extends implements Comparable {
@ManyToMany(fetch = FetchType.EAGER cascade = { CascadeType.ALL })
@JoinTable(name = "user_group_rel" joinColumns = @JoinColumn(name = "mhs_user_id") inverseJoinColumns = @JoinColumn(name = "group_id"))
public List getGroups() {
return groups;
}
public void setGroups(List groups) {
this.groups = groups;
}
}

In the above mhs_user_id is the identity column in the MHS_USER table and grp_id is the identity key in the GROUP table. USER_GROUP_REL table is the join table that contain the relation between the two. When I persist a new member instance it works as expected (by inserting a record into the parent table as well as the child table). However when I try updating any values to the member instance PropertyAccessException is thrown. following is the selective stack trace
------------------------------------------------------------------------------------------
1/14/11 13:59:10:154 CST 0000004b SystemErr R Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of edu.mayo.hcdm.mhsr.businessobject.Group.id
at org.hibernate.feature.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:171)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:183)
………………………………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………..
……………………………………………………………………………………………………………………………………………….. 1/14/11 13:59:10:154 CST 0000004b SystemErr R ... 90 more
1/14/11 13:59:10:154 CST 0000004b SystemErr R Caused by: java.language.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
------------------------------------------------------------------------------------------

It get’s confusing as Hibernate throws an error that the "object is not an instance of declaring class" when searching for the group_id from the GROUP table only on updates. I got a lot of threads online about it being a hibernate error (am using Hibernate 3.3.1). Has someone encountered the similar issue and if so how did you end up solving it?
Any input is highly apprised.


65 Viewed this Question



 Recent Replies on "Hibernate : org.hibernate.PropertyAccessException: IllegalArgumentException"

  • Nobody has replied on this post, be first to post answer.

Post Your Solution for this Question


Note: Please Put Code into <code></code> block.

Threads related to "Hibernate : org.hibernate.PropertyAccessException: IllegalArgumentException":

java EE installation and setup

i require to develop a simple email member in Java. I will be using JavaMail APIs of Java EE. I installed NetBeans that supports Java EE from this site:http://netbeans.org/downloads/If I select the option of making a Java EE application while making project I don't get the drag-n-drop feature of making GUI with swings. And if I select Java Desktop application I get the GUI making functions but then Java EE libraries are not available. How can i use these two simultaneously?Also the NetBeans installer seems to

Temporary tables using JDBC with null ResultSet

I am executing a stored procedure via standard JDBC Connection using MS SQL Driver Ver. 3.0.I hv found that when I generate and insert data into a temporary table the stored procedure doesn't execute properly.The Java code snippet snippet will not throw a exception but the javax.sql.ResultSet will be null.The point of failure in the stored procedure is when I un-comment the INSERT INTO #TBL CLM_NAME VALUES('VAL')When I execute the statement using SQL Studio Manager it executes without hassle and the data as exp

Why trim is not working?

I am trying to trim leading whitespaces from the string and I do not know what's wrong with my approach any solution would be apprised ?code snippet snippet:this.poNumber = poNumber.equals("") ? poNumber : poNumber.trim();am reading poNumber from csv file as "     IG078565 and IG083060 " and o/p also am getting similar value with similar whitespaces not sure why ?UpdatedAdding complete method for superior context:public BillingDTO(String currency String migrationId String charg

Best way to connect Java and Visual Studio 6 C++ via API

We have a web platform written in Java. It will expose specific functionality via little sort of an API - soap rest or little sort of home-brewed XML. The point is that it'll expose itself via HTTP/s.there's other stand alone application that was written in C++ (Visual Studio 6) which needs to connect to the aforementioned API. I'm not an excellent in C++ so I hv typical time recommending something that can accomplish the task. I'm mentioning VS6 as per request of our developer since upgrading i

Using Netbeans Debugger with an Included Library

Howdy folks! My very first solutionoferror post. Most exciting!In NetBeans 6.9.1 I hv made a wrapper project around an existing project in order to show a friendly GUI front-end. Since our members should never see this GUI it really has no business in the original project. The original project is included as a named Library of the wrapper project via the Project Properties > Libraries tab.I set a breakpoint in the original project then run the wrapper project in Debug mode via Debug > D

Selenium internal server error cause by captureNetworkTraffic()?

essentially I'm spawning a multitude of selenium member instances which all connect to one selenium server.Running about 20 at one time works perfectly best on my box.I then added a feature that uses the captureNetworkTraffic() method to read the network traffic as JSON so that I can log the stats to each instance's respective run log.And now suddenly if I run anymore than can be 3 or 4 at one time they nearly all fail with a lovely "Internal Selenium Server Error"!I hv done

Workaround to not shutdown DefaultHttpClient() each time after usage

always I do a Http request I invoke this methodprivate JSONObject getRequest(HttpUriRequest requestType) { httpClient = new DefaultHttpClient(); // making an instance here try { httpResponse = httpClient.execute(requestType); if (httpResponse != null && httpResponse.getStatusLine().getStatusCode() == 200) { httpEntity = httpResponse.getEntity(); if (httpEntity != null) { InputStream instream = httpEntity.getContent(); String convertedString = convertStreamToString(instream); return co

In hadoop, how do I initialize the a DistributedFileSystem object via the initialize method?

there're two arguments a URI and a Configuration. I assume that the JobConf object that the member is set to should work for Configuration but what about the URI?it's my code snippet snippet snippet I hv for the driver:JobClient member = new JobClient();JobConf conf = new JobConf(ClickViewSessions.class);conf.setJobName("ClickViewSessions");conf.setOutputKeyClass(LongWritable.class);conf.setOutputValueClass(MinMaxWritable.class);FileInputFormat.addInputPath(conf new Path("input"))

Implementing Webservice on JBoss, maven and choices

I 'm to manipulate a webservice in JBoss5 running on Java 6. According to the JBoss Documentation the choices are either use the JBoss native implementation CXF or metro. As native wont require any extra libraries (CXF would pull in Spring?) I thought that this would be the first option. The WS contract is given in an WSDL so i require to generate the stubs out of it. But the JBoss tools bark at the WSDL whereas CXF wsdl2java happily produces sources. Can I use these sources and not based on CX

Reflection best practices closed

Is this right approach to call database to get count of records using Reflection method invocation.Regards Chaitu