-->
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.  [ 2 posts ] 
Author Message
 Post subject: Upgrade to 3.3.2 causes IllegalArgumentException
PostPosted: Thu Oct 29, 2009 3:54 pm 
Newbie

Joined: Thu Oct 29, 2009 3:38 pm
Posts: 2
I've been successfully using Hibernate 3.1.x for some time and upgraded to 3.3.2. I'm getting the following error when my application fires up and tries to read some data:
Code:
2009-10-29 13:50:10,707 ERROR property.BasicPropertyAccessor: IllegalArgumentException in class: com.bst.optimizer.model.Subjective, setter method of property: Summary
2009-10-29 13:50:10,707 ERROR property.BasicPropertyAccessor: expected type: com.bst.optimizer.model.questionSummary.SurveyQuestionSummaryDocument, actual value: java.lang.String

In summary, I have a Session object and a Subjective object that extends Session. The Session object has a 'String summary' attribute with appropriate accessors. The Session class:
Code:
public abstract class Session
      extends      PersistentNamedObject
      implements   ISynchable,
               ISession
{
   private String         summary;

   public String getSummary() { return summary; }
   public void setSummary(String summary) { this.summary = summary; }
}

The Subjective class overrides the 'setSummary()' method with the following:
Code:
public class Subjective extends Session implements ISurveySession {
        . . . .
   public void setSummary(SurveyQuestionSummaryDocument summaryDoc) {
      setSummary(summaryDoc.toString());
   }
}

The mappings follow. There are other attributes in both classes, but they are unimportant for this discussion.
The (simple) Session mapping:
Code:
<hibernate-mapping package="com.bst.optimizer.model">
<class name="Session" table="SESSION">

   <id name="key" column="sessionKey">
      <generator class="native"/>
   </id>
   
   <!-- Timestamp -->
   <timestamp name="Ts" column="ts" source="vm"/>
   
   <property name="Summary"   type="text"         column="summary" />

</class>

</hibernate-mapping>

The (simple) Subjective mapping:
Code:
<hibernate-mapping package="com.bst.optimizer.model">
<joined-subclass name="Subjective" extends="Session" table="SUBJECTIVE">

   <key column="sessionKey"/>
   
</joined-subclass>
</hibernate-mapping>

Ideas?


Top
 Profile  
 
 Post subject: Re: Upgrade to 3.3.2 causes IllegalArgumentException
PostPosted: Thu Oct 29, 2009 4:28 pm 
Newbie

Joined: Thu Oct 29, 2009 3:38 pm
Posts: 2
I can get this to work by changing the accessibility of the 'String summary' to 'protected' in the base Session class and then add/duplicate the following code in the Subjective class:
Code:
   public void setSummary(String summary) { this.summary = summary; }

This is duplicated from the base Session class. Seems like a hack....


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