title: Serialization exception in java
body: <p>I have a legacy code that I have been getting headache working on.
  So here we go.</p>
  
  <pre><code>public class SelectionItem implements Serializable {
  private String            id;
  private String            description;
  
  public SelectionItem(String id, String description) {
      this.id = id;
      this.description = description;
  }
  
  public String getId() {
      return this.id;
  }
  
  public String getDescription() {
      return this.description;
  }
  
  @Override
  public String toString() {
      return this.description;
  }
  
  public void setDescription(String description) {
      this.description = description;
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>@Entity
  public class AC2GuiNamedConfigurationBean implements Serializable {
  private static final long             serialVersionUID =    -6964702304270690484L;
  
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private int                           id;
  
  @Column(length = 32768)
  private HashMap&lt;String, Serializable&gt; configurationData;
  
  ...
  </code></pre>
  
  <p>The configurationData is merely made up of SelectionItem objects.
  So whenever I try to update my bean, I get </p>
  
  <pre><code>org.hibernate.type.SerializationException: could not deserialize
  </code></pre>
  
  <p>which is caused by </p>
  
  <pre><code>Caused by: java.lang.ClassNotFoundException: SelectionItem from [Module "org.hibernate:main"...
  </code></pre>
  
  <p>what I really don't understand because the SelectionItem class is present.
  I can save the bean as many times as I want without error as long as there is no change in the configurationData field. But any changes, as little they might be, will throw the exception.</p>
  
  <p>Thanks</p>