-->
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.  [ 3 posts ] 
Author Message
 Post subject: ClassCastException when performing saveOrUpdate on a detache
PostPosted: Tue Jan 24, 2006 6:08 pm 
Newbie

Joined: Fri Jun 24, 2005 10:40 am
Posts: 17
I am building an admin application to configure a tree of data when I take a node in the tree change its effective dates and send it back to our RMI serivce I recieve a ClassCastException. Anybody have any ideas what to look for to resolve the issue. Thanks in advance

Hibernate version: 3.0.5

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

<hibernate-mapping>
   <class name="net.hcsc.service.perfmngmt.scorecard.Scorecard" table="SCORECARD">
      <composite-id name="id" class="net.hcsc.service.perfmngmt.scorecard.ScorecardId" unsaved-value="undefined">
         <key-property name="id" column="SCORECARD_ID" type="string" />
         <key-property name="version" column="SCORECARD_VERSION" type="integer" />
      </composite-id>
      <timestamp name="updateDateTime" column="SCORECARD_LAST_UPDATE" unsaved-value="null" />
      <component name="name" class="net.hcsc.service.perfmngmt.scorecard.ScorecardName">
         <property name="name" column="SCORECARD_NAME" type="string" />
      </component>
      <property name="description" column="SCORECARD_DESCRIPTION" type="string" not-null="false" length="5000" />
      <property name="order" column="SCORECARD_ORDER" type="integer" not-null="false" length="5000" />
      <!--<component name="comment" class="net.hcsc.service.perfmngmt.result.Comment">
         <property name="title" column="SCORECARD_COMMENT_TITLE" type="string" not-null="false"/>
         <property name="comment" column="SCORECARD_COMMENT" type="net.hcsc.service.perfmngmt.persistance.TextType" not-null="false"  length="700"/>         
         </component>-->
      <component name="effectiveDates" class="net.hcsc.util.id.EffectiveDates">
         <property name="startDate" column="SCORECARD_START_DATE" type="calendar" not-null="false" />
         <property name="endDate" column="SCORECARD_END_DATE" type="calendar" not-null="false" />
      </component>
      <!-- Parent can be null for root categories. -->

      <map name="indicators" table="INDICATORS" cascade="all" lazy="false">
         <key>
            <column name="SCORECARD_ID" />
            <column name="SCORECARD_VERSION" />
         </key>
         <map-key column="INDICATOR" type="string" />
         <!--<map-key formula="indicator" type="string"/>-->
         <!--<many-to-many column="INDICATOR_ID"  unique="true" class="net.hcsc.service.perfmngmt.indicator.ScorecardIndicator"/>-->
         <one-to-many class="net.hcsc.service.perfmngmt.indicator.ScorecardIndicator" />
      </map>
      <set name="childScorecards" cascade="all" table="SCORECARD_CHILDREN" inverse="false" lazy="false" sort="net.hcsc.service.perfmngmt.scorecard.ScorecardComparator">
         <key>
            <column name="PARENT_SCORECARD_ID" />
            <column name="PARENT_SCORECARD_VERSION" />
         </key>
         <!--<composite-map-key class="net.hcsc.service.perfmngmt.scorecard.ScorecardId">
            <key-property name="id" column="SCORECARD_ID"  type="string"/>
            <key-property name="version" column="SCORECARD_VERSION"  type="integer"/>
            </composite-map-key>-->
         <many-to-many class="net.hcsc.service.perfmngmt.scorecard.Scorecard">
            <column name="CHILD_SCORECARD_ID" />
            <column name="CHILD_SCORECARD_VERSION" />
         </many-to-many>
      </set>
      <set name="parents" cascade="all" table="SCORECARD_CHILDREN" lazy="false" inverse="true">
         <key>
            <column name="CHILD_SCORECARD_ID"/>
            <column name="CHILD_SCORECARD_VERSION"/>
         </key>
         <many-to-many class="net.hcsc.service.perfmngmt.scorecard.Scorecard">
            <column name="PARENT_SCORECARD_ID" not-null="true" />
            <column name="PARENT_SCORECARD_VERSION" not-null="true" />
         </many-to-many>
      </set>
      <set name="measures" table="SCORECARD_MEASURE" cascade="all" lazy="true" >
         <key>
            <column name="SCORECARD_ID" />
            <column name="SCORECARD_VERSION" />
         </key>
         <!--<composite-map-key class="net.hcsc.util.id.VersionedID">
            <key-property name="id" column="ASSOC_MEASURE_ID" type="string" />
            <key-property name="version" column="ASSOC_MEASURE_VERSION" type="integer" />
         </composite-map-key>-->
         <many-to-many class="net.hcsc.service.perfmngmt.scorecard.AssociatedMeasure">
            <column name="ASSOC_MEASURE_ID" />
            <column name="ASSOC_MEASURE_VERSION" />
         </many-to-many>                   
      </set>
      <map name="properties" table="PROPERTIES" cascade="all" lazy="true">
         <key>
            <column name="SCORECARD_ID" />
            <column name="SCORECARD_VERSION" />
         </key>
         <map-key column="PROPERTY_NAME" type="string" />
         <one-to-many class="net.hcsc.service.perfmngmt.properties.Property" />
      </map>
      <many-to-one name="comment" column="COMMENT_ID" not-null="false" class="net.hcsc.service.perfmngmt.result.Comment" cascade="all" lazy="false" />      
   </class>
</hibernate-mapping>



Code between sessionFactory.openSession() and session.close():
Code:
/**
    * Persists a Scorecard object
    * @param aScorecard
    * @throws BusinessException
    */
   public void makePersistent(Scorecard aScorecard) throws UnableToPersistObjectException {   
         try {
            getSession().saveOrUpdate(aScorecard);
         } catch (DataAccessResourceFailureException darfe) {
            throw new UnableToPersistObjectException(new TraceableException(darfe));
         } catch (HibernateException he) {
            throw new UnableToPersistObjectException(new TraceableException(he));
         } catch (IllegalStateException ise) {
            throw new UnableToPersistObjectException(new TraceableException(ise));
         }      
   }

Code:

import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;

import net.hcsc.service.perfmngmt.definition.BaseDefinition;
import net.hcsc.service.perfmngmt.indicator.ScorecardIndicator;
import net.hcsc.service.perfmngmt.result.Comment;
import net.hcsc.service.perfmngmt.visitor.IVisitor;
import net.hcsc.util.exception.BusinessException;
import net.hcsc.util.id.EffectiveDates;

public class Scorecard extends BaseDefinition {   
   /**
    * Field serialVersionUID
    */
   private static final long serialVersionUID = -5700370366863250797L;

   /**
    * Field childScorecards
    */
   private SortedSet childScorecards  = new TreeSet(new ScorecardComparator());

   /**
    * Field comment
    */
   private Comment comment;

   /**
    * Field description
    */
   private String description = "";

   /**
    * Field effectiveDates
    */
   private EffectiveDates effectiveDates;

   /**
    * Field id
    */
   private ScorecardId id;
   
   /**
    * Field indicators
    */
   private Map indicators = new HashMap();

   /**
    * Field measures
    */
   private Set measures = new HashSet();
   
   /**
    * Field name
    */
   private ScorecardName name;

   /**
    * Field orderweight
    */
   private int order;
   
   /**
    * Field id
    * @supplierCardinality 0..*
    */
   private Set parents = new HashSet();
      
   /**
    * Simple Constructor
    *
    */
   public Scorecard() {
      id = new ScorecardId();
   }

   /**
    * Constructor for Scorecard
    *
    * @param aName   
    * @param aDescription   
    * @throws BusinessException
    */
   public Scorecard(ScorecardName aName, String aDescription)    throws BusinessException {
      if (aName.getName().trim().length() == 0) {
         throw new BusinessException("Required parameter aName is empty"); //$NON-NLS-1$
      }
      id = new ScorecardId();
      
      name = new ScorecardName(aName.getName().trim());
      
      if (aDescription == null) {
         description = new String("");
      } else {
         description = aDescription;
      }
      
      //comment = new Comment("","");
   }

   /**
    * Cause the given visitor to visit this node and all children of this
    * node.
    *
    * @param visitor the visitor to be accepted
    *
    * @see net.hcsc.service.perfmngmt.visitor.IVisitor
    */
   public void accept(IVisitor visitor) {
      visitor.visitScorecard(this);
   }

   /**
    * Method addChildScorecard
    * @param sc
   
    */
   public void addChildScorecard(Scorecard sc) {
      if (childScorecards == null) {
         childScorecards = new TreeSet(new ScorecardComparator());
      }
      /*if (sc.getParents() != null) {
         sc.getParents().getChildScorecards().remove(sc);
      }*/      
      if (!childScorecards.contains(sc)) {               
         childScorecards.add(sc);
         createVersion = true;
         if (!getId().equals(sc.getId())) {
            addParentScorecard(this);
         }
      }      
   }

   /**
    * Adds an indicator to the indicator list
    * @param aIndicator
    */
   public void addIndicator(ScorecardIndicator aIndicator) {
      if (indicators == null) {
         indicators = new HashMap();
      }
      indicators.put(aIndicator.getIndicator(),aIndicator);      
   }

   /**
    * Method addMeasure
    * @param measure
    * @associates net.hcsc.service.perfmngmt.scorecard.AssociatedMeasure
    * @supplierCardinality 0..*
    * @directed
    */
   public void addMeasure(AssociatedMeasure measure) {
      if (measures == null) {
         measures = new HashSet();
      }
      measures.add(measure);
      createVersion = true;
   }
   
   public void addParentScorecard(Scorecard parent) {
      if (parents == null) {
         parents = new HashSet();
      }
      if (!getParents().contains(parent)) {         
         getParents().add(parent);
         createVersion = true;
         //addChildScorecard(this);
      }
   }
         
   /**
    * Method equals
    * @param other
    * @return boolean
    */
   public boolean equals(Object other) {
      if (other == this) {
         return true;
      }
      
      if((other == null) || (other.getClass() != this.getClass())) {
         return false;
      }
      Scorecard test = (Scorecard)other;
      return id.equals(test.getId()) && (name != null && name.equals(test.name)) && (description != null && description.equals(test.description)) && (comment != null && comment.equals(test.getComment()))
            && (effectiveDates != null && effectiveDates.equals(test.getEffectiveDates()));
   }

   /**
    * @return HashSet
    */
   public SortedSet getChildScorecards() {
      return childScorecards;      
   }

   /**
    * Method getComment
    * @return Comment
    */
   public Comment getComment() {
      return comment;
   }

   /**
    * Method getDescription
    * @return String
    */
   public String getDescription() {
      return description;
   }

   /**
    * Returns the effectiveDates of the scorecard
    * @return Returns the effectiveDates.
    */
   public EffectiveDates getEffectiveDates() {
      return effectiveDates;
   }

   /**
    * Method getId
    * @return ScorecardId
    */
   public ScorecardId getId() {
      return id;
   }

   /**
    * Method getType
    * @return ScorecardType
    */
   public Map getIndicators() {
      return indicators;
   }

   /**
    * @return HashSet
    */
   public Set getMeasures() {
      return measures;
   }

   /**
    * Method getName
    * @return GroupName
    */
   public ScorecardName getName() {
      return name;
   }

   /**
    * Returns the order.
    * @return Returns the order.
    */
   public int getOrder() {
      return order;
   }

   /**
    * Returns the parents collection
    * @return Returns the parents collection.
    */
   public Set getParents() {
      return parents;
   }

   /**
    * Method hashCode
    * @return int
    */
   public int hashCode() {
      int hashCode = 8;
      hashCode = 31 * hashCode + (null == id ? 0 : id.hashCode());
      hashCode = 31 * hashCode + (null == name ? 0 : name.hashCode());
      hashCode = 31 * hashCode + (null == description ? 0 : description.hashCode());
      hashCode = 31 * hashCode + (null == comment ? 0 : comment.hashCode());
      hashCode = 31 * hashCode + (null == effectiveDates ? 0 : effectiveDates.hashCode());
      
      return hashCode;
   }
   
   /**
    * Method removeChildScorecard
    * @param childScorecard
    */
   public void removeChildScorecard(Scorecard childScorecard) {
      if (childScorecard.getParents() != null) {
         //childScorecard.getParents().getChildScorecards().remove(childScorecard);
      }
      childScorecard.setParents(null);
      childScorecards.remove(childScorecard);
      createVersion = true;
   }

   /**
    * removes an indicator
    * @param aIndicator
    */
   public void removeIndicator(ScorecardIndicator aIndicator) {
      indicators.remove(aIndicator.getIndicator());
   }

   /**
    * Method removeMeasure
    * @param measure
    */
   public void removeMeasure(AssociatedMeasure measure) {
      measures.remove(measure.getAssocMeasureId());
      createVersion = true;
   }

   /**
    * @param set
    */
   public void setChildScorecards(SortedSet set) {      
      childScorecards = set;      
   }

   /**
    * @param aComment
    */
   public void setComment(Comment aComment) {
      this.comment = aComment;
   }

   /**
    * Method setDescription
    * @param aDescription
    */
   public void setDescription(String aDescription) {
      description = aDescription;
   }

   /**
    * Sets the effective dates of the scorecard
    * @param effectiveDates The effectiveDates to set.
    */
   public void setEffectiveDates(EffectiveDates effectiveDates) {
      this.effectiveDates = effectiveDates;
   }

   /**
    * @param anId ScorecardId
    */
   public void setId(ScorecardId anId) {
      id = anId;
   }

   /**
    * @param indicatorMap Map
    */
   public void setIndicators(Map indicatorMap) {
      this.indicators = indicatorMap;
   }
   /**
    * @param map
    */
   public void setMeasures(Set set) {      
      measures = set;
   }

   /**
    * @param aName
    */
   public void setName(ScorecardName aName) {
      this.name = aName;
   }

   /**
    * Sets the order.
    * @param order The order to set.
    */
   public void setOrder(int orderWeight) {
      this.order = orderWeight;
   }

   /**
    * Sets the Parent
    * @param aSet The parents to set.
    */
   public void setParents(Set aSet) {      
      this.parents = aSet;
   }

   /**
    * Method toString.
    * @return String
    */
   public String toString() {
      return this.getName().getName();
   }

   /**
    * Method toString
    * @return String
    */
   public String toStringFullObject() {
      Iterator indIterator;
      Iterator measureIterator;
      Iterator scorecardIterator;
      ScorecardIndicator scorecardIndicator;
      AssociatedMeasure measure;
      Scorecard child;
      StringBuffer buffer = new StringBuffer();
      
      buffer.append("\nScorecard: \n"); //$NON-NLS-1$
      buffer.append("Scorecard Id: " + getId() + "\n"); //$NON-NLS-2$ //$NON-NLS-1$
      buffer.append("Scorecard Name: " + getName() + "\n"); //$NON-NLS-2$ //$NON-NLS-1$
      buffer.append("Scorecard Descriptions: " + getDescription() + "\n"); //$NON-NLS-2$ //$NON-NLS-1$
      buffer.append("Scorecard Comment: " + getComment() + "\n"); //$NON-NLS-2$ //$NON-NLS-1$
      if (getEffectiveDates() != null) {
         buffer.append("Scorecard EffectiveDates: " + getEffectiveDates().toString() + "\n"); //$NON-NLS-2$ //$NON-NLS-1$
      } else {
         buffer.append("Scorecard EffectiveDates: null\n");
      }
      //buffer.append("Scorecard Parent: " + getParent().getId() + "\n");
      if (!getIndicators().isEmpty()) {
         buffer.append("Scorecard Indicators: \n"); //$NON-NLS-1$
         indIterator = getIndicators().values().iterator();
         while (indIterator.hasNext()) {
            scorecardIndicator = (ScorecardIndicator) indIterator.next();
            buffer.append(scorecardIndicator.toString() + "\n"); //$NON-NLS-1$
         }
      }   
      
      buffer.append("Scorecard Children: \n"); //$NON-NLS-1$
      if (!getChildScorecards().isEmpty()) {
         scorecardIterator = getChildScorecards().iterator();
         while (scorecardIterator.hasNext()) {
            child = (Scorecard)scorecardIterator.next();
            buffer.append(child.toStringFullObject() + "\n"); //$NON-NLS-1$
         }
      } else {
         buffer.append("This scorecard does not have children. \n"); //$NON-NLS-1$
      }
      
      
      if (!getMeasures().isEmpty()) {
         buffer.append("Scorecard Measures: \n"); //$NON-NLS-1$
         measureIterator = getMeasures().iterator();
         while (measureIterator.hasNext()) {
            measure = (AssociatedMeasure)measureIterator.next();
            buffer.append(measure.toStringFull() + "\n"); //$NON-NLS-1$
         }
      }   
      
      return buffer.toString();      
   }

   /*public int compareTo(Object arg0) {
      Scorecard sc1 = (Scorecard)arg0;      
            
      return Math.abs(order) - Math.abs(sc1.getOrder());      
   }   */
}





Name and version of the database you are using:
SQL Server 2000


The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:
2006-01-23 16:52:44,546 DEBUG [RMI TCP Connection(4)-127.0.0.1] (AbstractFlushingEventListener.java:167) - Flushing entities and processing referenced collections
2006-01-23 16:52:44,562 DEBUG [RMI TCP Connection(4)-127.0.0.1] (DefaultFlushEntityEventListener.java:121) - Updating entity: [net.hcsc.service.perfmngmt.scorecard.Scorecard#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f37, version=2}]
2006-01-23 16:52:44,562 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Versioning.java:26) - Incrementing: 2006-01-23 16:49:49.921 to 2006-01-23 16:52:44.562
2006-01-23 16:52:44,562 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.indicators#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f37, version=2}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.indicators#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f37, version=2}] (initialized)
2006-01-23 16:52:44,562 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.childScorecards#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f37, version=2}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.childScorecards#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f37, version=2}] (initialized)
2006-01-23 16:52:44,562 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.parents#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f37, version=2}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.parents#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f37, version=2}] (initialized)
2006-01-23 16:52:44,578 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.measures#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f37, version=2}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.measures#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f37, version=2}] (initialized)
2006-01-23 16:52:44,578 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.properties#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f37, version=2}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.properties#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f37, version=2}] (initialized)
2006-01-23 16:52:44,578 DEBUG [RMI TCP Connection(4)-127.0.0.1] (DefaultFlushEntityEventListener.java:121) - Updating entity: [net.hcsc.service.perfmngmt.indicator.ScorecardIndicator#3]
2006-01-23 16:52:44,578 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Versioning.java:26) - Incrementing: 2006-01-21 13:54:35.813 to 2006-01-23 16:52:44.578
2006-01-23 16:52:44,578 DEBUG [RMI TCP Connection(4)-127.0.0.1] (DefaultFlushEntityEventListener.java:121) - Updating entity: [net.hcsc.service.perfmngmt.scorecard.Scorecard#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f3a, version=1}]
2006-01-23 16:52:44,578 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Versioning.java:26) - Incrementing: 2006-01-21 13:54:40.42 to 2006-01-23 16:52:44.578
2006-01-23 16:52:44,578 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.indicators#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f3a, version=1}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.indicators#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f3a, version=1}] (initialized)
2006-01-23 16:52:44,578 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.childScorecards#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f3a, version=1}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.childScorecards#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f3a, version=1}] (initialized)
2006-01-23 16:52:44,578 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.parents#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f3a, version=1}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.parents#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f3a, version=1}] (initialized)
2006-01-23 16:52:44,578 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.measures#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f3a, version=1}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.measures#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f3a, version=1}] (initialized)
2006-01-23 16:52:44,578 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.properties#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f3a, version=1}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.properties#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f3a, version=1}] (initialized)
2006-01-23 16:52:44,578 DEBUG [RMI TCP Connection(4)-127.0.0.1] (DefaultFlushEntityEventListener.java:121) - Updating entity: [net.hcsc.service.perfmngmt.indicator.ScorecardIndicator#1]
2006-01-23 16:52:44,593 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Versioning.java:26) - Incrementing: 2006-01-21 13:54:40.42 to 2006-01-23 16:52:44.593
2006-01-23 16:52:44,593 DEBUG [RMI TCP Connection(4)-127.0.0.1] (DefaultFlushEntityEventListener.java:121) - Updating entity: [net.hcsc.service.perfmngmt.indicator.ScorecardIndicator#2]
2006-01-23 16:52:44,593 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Versioning.java:26) - Incrementing: 2006-01-21 13:54:40.42 to 2006-01-23 16:52:44.593
2006-01-23 16:52:44,593 DEBUG [RMI TCP Connection(4)-127.0.0.1] (DefaultFlushEntityEventListener.java:121) - Updating entity: [net.hcsc.service.perfmngmt.scorecard.Scorecard#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f36, version=1}]
2006-01-23 16:52:44,593 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Versioning.java:26) - Incrementing: 2006-01-21 13:54:36.78 to 2006-01-23 16:52:44.593
2006-01-23 16:52:44,593 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.indicators#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f36, version=1}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.indicators#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f36, version=1}] (initialized)
2006-01-23 16:52:44,593 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.childScorecards#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f36, version=1}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.childScorecards#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f36, version=1}] (initialized)
2006-01-23 16:52:44,593 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.parents#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f36, version=1}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.parents#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f36, version=1}] (initialized)
2006-01-23 16:52:44,593 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.measures#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f36, version=1}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.measures#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f36, version=1}] (initialized)
2006-01-23 16:52:44,593 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Collections.java:140) - Collection found: [net.hcsc.service.perfmngmt.scorecard.Scorecard.properties#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f36, version=1}], was: [net.hcsc.service.perfmngmt.scorecard.Scorecard.properties#component[id,version]{id=7a7283a0e0f26de9:4413ee:108ee882e68:-7f36, version=1}] (initialized)
2006-01-23 16:52:44,609 DEBUG [RMI TCP Connection(4)-127.0.0.1] (DefaultFlushEntityEventListener.java:121) - Updating entity: [net.hcsc.service.perfmngmt.indicator.ScorecardIndicator#20]
2006-01-23 16:52:44,609 DEBUG [RMI TCP Connection(4)-127.0.0.1] (Versioning.java:26) - Incrementing: 2006-01-21 13:54:36.78 to 2006-01-23 16:52:44.609
2006-01-23 16:52:44,609 DEBUG [RMI TCP Connection(4)-127.0.0.1] (JDBCTransaction.java:132) - rollback
2006-01-23 16:52:44,609 DEBUG [RMI TCP Connection(4)-127.0.0.1] (JDBCContext.java:278) - before transaction completion
2006-01-23 16:52:44,609 DEBUG [RMI TCP Connection(4)-127.0.0.1] (SessionImpl.java:372) - before transaction completion
2006-01-23 16:52:44,609 DEBUG [RMI TCP Connection(4)-127.0.0.1] (JDBCTransaction.java:143) - rolled back JDBC Connection
2006-01-23 16:52:44,609 DEBUG [RMI TCP Connection(4)-127.0.0.1] (JDBCContext.java:283) - after transaction completion
2006-01-23 16:52:44,609 DEBUG [RMI TCP Connection(4)-127.0.0.1] (SessionImpl.java:403) - after transaction completion
2006-01-23 16:52:44,609 DEBUG [RMI TCP Connection(4)-127.0.0.1] (SessionImpl.java:269) - closing session
2006-01-23 16:52:44,609 DEBUG [RMI TCP Connection(4)-127.0.0.1] (ConnectionManager.java:317) - closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2006-01-23 16:52:44,609 DEBUG [RMI TCP Connection(4)-127.0.0.1] (JDBCContext.java:283) - after transaction completion
2006-01-23 16:52:44,625 DEBUG [RMI TCP Connection(4)-127.0.0.1] (SessionImpl.java:403) - after transaction completion
2006-01-23 16:52:44,640 WARN [RMI TCP Connection(4)-127.0.0.1] (RemoteInvocationTraceInterceptor.java:78) - Processing of RmiServiceExporter remote call resulted in fatal exception: net.hcsc.service.perfmngmt.service.admin.IKpiAdmin.saveScorecard
java.lang.ClassCastException
at org.hibernate.type.ComponentType.isModified(ComponentType.java:468)
at org.hibernate.type.ManyToOneType.isModified(ManyToOneType.java:118)
at org.hibernate.type.TypeFactory.findModified(TypeFactory.java:455)
at org.hibernate.persister.entity.BasicEntityPersister.findModified(BasicEntityPersister.java:2566)
at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:356)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:108)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:190)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:70)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:324)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:490)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:495)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:468)
at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:258)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
at net.hcsc.service.perfmngmt.service.admin.KpiAdminImpl$$EnhancerByCGLIB$$384d4cb9.saveScorecard(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:292)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:68)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy2.saveScorecard(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:179)
at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:33)
at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:76)
at org.springframework.remoting.rmi.RmiBasedExporter.invoke(RmiBasedExporter.java:72)
at org.springframework.remoting.rmi.RmiInvocationWrapper.invoke(RmiInvocationWrapper.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 25, 2006 6:18 am 
Senior
Senior

Joined: Tue May 10, 2005 9:00 am
Posts: 125
Am not sure, are you doing this?

1) extract a Scorecard using hibernate
2) send the Scorecard to a rmi layer for a client
3) have client modify this Scorecard
4) have client send back Scorecard
5) have rmi server store the modified Scorecard in hibernate

If yes, it's probable there is a mix up between classes unmarshalled from RMI layer and classes enhanced by CGLib. There has been a somehow similar problem with JBoss classloader in the past. Maybe this link can be helpful:

http://opensource2.atlassian.com/projec ... key=HB-692


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 25, 2006 10:00 am 
Newbie

Joined: Fri Jun 24, 2005 10:40 am
Posts: 17
That would be correct. I apologize if I was not clear. I will check out the link. Thanks for the info


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