title: Rejected value [null] error even after assigning to the property
body: <p>I have a Grails Class called <code>MachineInstance</code> and the following code</p>
  
  <pre><code>machineInstanceInstance.reservationId = reservation.reservationId
  println "-------"+reservation.reservationId+"====="+machineInstanceInstance.reservationId
  </code></pre>
  
  <p>I am specifically assigning <code>reservationId</code> to the object, it also gets printed but right below it I have following two lines of code. Both of these outputs error saying <code>Field error in object 'com.ch.MachineInstance' on field 'reservationId': rejected value [null]</code></p>
  
  <pre><code>machineInstanceInstance.errors.each{println it}
  if (machineInstanceInstance.hasErrors()) { more code   }        
  </code></pre>