title: Filed error in object 'objname' on field:'fieldname' : rejected value [null];
body: <p>I'm a beginner and I'm tring to create an application that is similar to twitter</p>
  
  <p>I have 3 domain classes i.e. user,tweets and followers.</p>
  
  <p>Followers domain is maintain the link between two user to follow each other.</p>
  
  <p>When I perform save() on the follower it throws the following error, I'm not able to figure out where im going wrong:</p>
  
  <blockquote>
    <p>Field error in object 'mail.Follower' on field 'follower': rejected value [null]; codes [mail.Follower.follower.nullable.error.mail.Follower.follower,mail.Follower.follower.nullable.error.follower,mail.Follower.follower.nullable.error.mail.User,mail.Follower.follower.nullable.error,follower.follower.nullable.error.mail.Follower.follower,follower.follower.nullable.error.follower,follower.follower.nullable.error.mail.User,follower.follower.nullable.error,mail.Follower.follower.nullable.mail.Follower.follower,mail.Follower.follower.nullable.follower,mail.Follower.follower.nullable.mail.User,mail.Follower.follower.nullable,follower.follower.nullable.mail.Follower.follower,follower.follower.nullable.follower,follower.follower.nullable.mail.User,follower.follower.nullable,nullable.mail.Follower.follower,nullable.follower,nullable.mail.User,nullable]; arguments [follower,class mail.Follower]; default message [Property [{0}] of class [{1}] cannot be null]
    Field error in object 'mail.Follower' on field 'user': rejected value [null]; codes [mail.Follower.user.nullable.error.mail.Follower.user,mail.Follower.user.nullable.error.user,mail.Follower.user.nullable.error.mail.User,mail.Follower.user.nullable.error,follower.user.nullable.error.mail.Follower.user,follower.user.nullable.error.user,follower.user.nullable.error.mail.User,follower.user.nullable.error,mail.Follower.user.nullable.mail.Follower.user,mail.Follower.user.nullable.user,mail.Follower.user.nullable.mail.User,mail.Follower.user.nullable,follower.user.nullable.mail.Follower.user,follower.user.nullable.user,follower.user.nullable.mail.User,follower.user.nullable,nullable.mail.Follower.user</p>
  </blockquote>
  
  <p>this is my code</p>
  
  <p>domain </p>
  
  <pre><code>package mail
  
  class User {
      String name
      String email
      String password
      int age
  
  static constraints = {
      name blank:false
      email blank:false
      password blank:false
      age blank:false
  
      }
  static hasMany=[tweets:Tweets,followers:Follower]
  
  
  
  }
  </code></pre>
  
  <p>followers domain</p>
  
  <pre><code>package mail
  
  class Follower {
      User follower
  static constraints = {
      follower nullable:false
  
  }
  static belongsTo=[user:User]
  
  
  }
  </code></pre>
  
  <p>this is the follower controller</p>
  
  <pre><code>package mail
  import grails.converters.JSON
  class FollowerController {
  
  
  static allowedMethods = [save: "POST", update:"POST", delete:"POST",authenticate:"POST"]
  
  def responseBody =[:]
  
  def index() {}
  
  def list(){
      render Follower.list(sort:"dateCreated",order:"desc") as JSON
  }
  
  def get(Long id)
  {
      def followerInstace=Follower.get(id)
      render followerInstace as JSON
  }
  
  def save()
  {
    def followerInstace=new Follower(request.JSON)
    def user=User.get(session.loggedInUser.id)
    println user
    if(followerInstace.save(flush:true))
    {
        user.addToUser(followerInstace.id)
        responseBody.message="saved successfully"
       responseBody.id=followerInstace.id
       responseBody.code=200
       render responseBody as JSON
       return
    }
    println followerInstace.errors
    responseBody.message="save not successfull"
     responseBody.code=400
    println responseBody
    render responseBody as JSON
  }
  
  def show(Long id)
  {
      def followerInstance=Follower.get(id)
      if(followerInstance)
      {
          responseBody.code=200
          resoponseBody.mesage="file found"
          responseBody.followerInstance=followerInstance
          render responseBody as JSON
      }
      else
      {
          responseBody.code=404
          responseBody.message="Not Found"
          render responseBody as JSON
          return
      }
  }
  
  
  def delete(Long id)
  {
      def followerInstace= Follower.get(id)
      followerInstace.delete()
      responseBody.message = "successfully deleted"
      render responseBody as JSON
  }
  def update(Long id,Long version)
  {
      def followerInstance = Follower.get(id)
      followerInstance.properties = params
  
      if(followerInstance.save(flush:true))
      {
          responseBody.message="successfully updated"
          responseBody.code = 200
          responseBody.id = followerInstance.id
      }
      else {
          responseBody.code = 400
          responseBody.message = 'Some error(s) exist'
      }
      render responseBody as JSON
  }
  
  }
  </code></pre>