title: Hibernate 4.1 Errror: Could not create DynamicParameterizedType for type: org.hibernate.type.EnumType
body: <p>I am trying to upgrade my project from hibernate 3.6 to 4.1.6, I think I have got all the jars in the right place, ... etc but now I have this exception below googling has not yielded an answer. My code runs fine on Hibernate 3.6 and I am not sure if this is a problem with my mappings or something else.  I am configuring hibernate 4.1 with Spring 3.1.2 using the JPA approach. </p>
  
  <pre><code>Caused by: org.hibernate.MappingException: Could not create DynamicParameterizedType for type: org.hibernate.type.EnumType
          at org.hibernate.mapping.SimpleValue.createParameterImpl(SimpleValue.java:398)
          at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:304)
          at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:294)
          at org.hibernate.mapping.Property.isValid(Property.java:238)
          at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:469)
          at org.hibernate.mapping.RootClass.validate(RootClass.java:270)
          at org.hibernate.cfg.Configuration.validate(Configuration.java:1294)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1738)
          at org.hibernate.ejb.EntityManagerFactoryImpl.&lt;init&gt;(EntityManagerFactoryImpl.java:94)
          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)
          ... 55 more
      Caused by: java.lang.ClassNotFoundException: char
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:186)
          at org.hibernate.internal.util.ReflectHelper.classForName(ReflectHelper.java:192)
          at org.hibernate.mapping.SimpleValue.createParameterImpl(SimpleValue.java:389)
          ... 64 more
  </code></pre>
  
  <p><strong>Update:</strong> I have put break points in the hibernate code where that exception is caught and have found the mapping that it does not like, here is it below. </p>
  
  <pre><code>@Entity
  @Table(name = "company_addresses")
  public class CompanyAddress extends TimeStampedPersistableObject
  {
  public enum AddressType
  {
      PUBLIC('p'), SHAREHOLDER('s');
  
      private final char typeCode;
  
      AddressType(char typeCode)
      {
          this.typeCode = typeCode;
      }
  
      public static AddressType parse(char c)
      {
          for (AddressType addressType : AddressType.values())
          {
              if (addressType.value() == c)
              {
                  return addressType;
              }
          }
          return null;
      }
  
      public char value()
      {
          return typeCode;
      }
  }
  
  @Column(name = "address_type")
  @Enumerated(EnumType.STRING)
  private char type;
  </code></pre>