title: org.hibernate.MappingException for domain classes in grails
body: <p>I have a grails project and everything has been running fine. I started adding JAXB XML annotations to my groovy domain classes and all of a sudden I start getting this stack dump. What do I need to do to fix this, and why is it showing up after I started added the XML annotations?</p>
  
  <pre><code>2010-09-21 09:46:43,006 [main] ERROR context.ContextLoader  - Context initialization failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.s
  pringframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while
  setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto
  ry': Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not determine type for: skillsdb.Client, at table: project, for
   columns: [org.hibernate.mapping.Column(client)]
      at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:164)
      at grails.web.container.EmbeddableServer$start.call(Unknown Source)
      at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
      at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
      at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
      at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
      at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
      at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
      at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116)
      at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
      at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
      at RunApp$_run_closure1.doCall(RunApp.groovy:33)
      at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
      at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
      at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
      at gant.Gant.withBuildListeners(Gant.groovy:427)
      at gant.Gant.this$2$withBuildListeners(Gant.groovy)
      at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
      at gant.Gant.dispatch(Gant.groovy:415)
      at gant.Gant.this$2$dispatch(Gant.groovy)
      at gant.Gant.invokeMethod(Gant.groovy)
      at gant.Gant.executeTargets(Gant.groovy:590)
      at gant.Gant.executeTargets(Gant.groovy:589)
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessio
  nFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with na
  me 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not determine type for: skillsdb.Client, at tab
  le: project, for columns: [org.hibernate.mapping.Column(client)]
      ... 23 more
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exc
  eption is org.hibernate.MappingException: Could not determine type for: skillsdb.Client, at table: project, for columns: [org.hibernate.mapping.Column(client)]
      ... 23 more
  Caused by: org.hibernate.MappingException: Could not determine type for: skillsdb.Client, at table: project, for columns: [org.hibernate.mapping.Column(client)]
  
      ... 23 more
  </code></pre>
  
  <p>Project.groovy:</p>
  
  <pre><code>package skillsdb;
  import rc.RoleComparator;
  import org.apache.commons.collections.list.LazyList;
  import org.apache.commons.collections.FactoryUtils;
  import javax.xml.bind.annotation.XmlAccessType;
  import javax.xml.bind.annotation.XmlAccessorType;
  import javax.xml.bind.annotation.XmlAttribute;
  import javax.xml.bind.annotation.XmlElement;
  import javax.xml.bind.annotation.XmlElementWrapper;
  import javax.xml.bind.annotation.XmlSeeAlso;
  
  @XmlAccessorType(XmlAccessType.NONE)
  @XmlSeeAlso(Client.class)
  public class Project implements Comparable
  {  
  static belongsTo = [employee:Employee]
  
  static hasMany = [roles:Role]
  
  static mapping = {
        description type:"text"
        roles lazy:false, cascade:"all,delete-orphan"
  }
  @XmlElement
  Client client
  }
  </code></pre>
  
  <p>Client.groovy</p>
  
  <pre><code>package skillsdb;
  import javax.xml.bind.annotation.XmlAttribute;
  class Client implements Comparable
  {
   static constraints = 
    {
        name(blank:false)
    }
    @XmlAttribute
    String name
  }
  </code></pre>