title: Grails : Error saving object, hard to understand, don't use 'property' keyword
body: <p>I get a domain class like that :</p>
  
  <pre><code>class Offer {
  
      Property property
      Building building
      ExternalSystem externalSystem
      OfferStatus status
      Double offerPrice
      String currency
      String description
      String adventages
      Date offerDisponibility
      OfferNature offerNature
      Surfaces surfaces
  
      static hasMany = [units: Unit]
  
      static constraints = {
          building nullable: true
          externalSystem nullable: true
          description nullable: true
          adventages nullable: true
      }
  }
  </code></pre>
  
  <p>When populating it into a controller :</p>
  
  <pre><code>def offer = new Offer()
  offer.property = Property.get(1)
  offer.building = Building.get(1)
  offer.externalSystem = ExternalSystem.get(1)
  offer.status = OfferStatus.get(1)
  offer.offerPrice = 26860
  offer.currency = 'EUR'
  offer.description = 'WONDERFULL OFFER !'
  offer.offerDisponibility = convertDate('12/04/2014')
  offer.offerNature = OfferNature.read(1)
  offer.surfaces = Surfaces.get(2)
  offer.validate()
  </code></pre>
  
  <p>I get a strange behaviour when validating, saving or whatever on this object.
  It is the only domain object domain wich do that.</p>
  
  <p>I get two different stacktrace, tha's the most strange part of my problem, the first stacktrace apear when I'm calling my controller the first time :</p>
  
  <pre><code>| Error 2013-11-26 11:27:10,971 [http-bio-8080-exec-2] ERROR errors.GrailsExceptionResolver  - ArrayIndexOutOfBoundsException occurred when processing
   request: [GET] /Project/login/auth
  0. Stacktrace follows:
  Message: 0
      Line | Method
  -&gt;&gt;  116 | doCall    in com.project.security.LoginController$_closure1
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  |    200 | doFilter  in grails.plugin.cache.web.filter.PageFragmentCachingFilter
  |     63 | doFilter  in grails.plugin.cache.web.filter.AbstractFilter
  |   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
  |    615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
  ^    722 | run       in java.lang.Thread
  </code></pre>
  
  <p>The second is alway the last stacktrace :</p>
  
  <pre><code>| Error 2013-11-26 11:01:43,704 [http-bio-8080-exec-3] ERROR [/Project].[default]  - Servlet.service() for servlet [default] in context with path [/Project] threw exception [org.springframework.web.util.NestedServletException: Request processing failed; nested exception is groovy.lang.MissingMethodException: No signature of method: static java.lang.Math.max() is applicable for argument types: (java.lang.Integer, null) values: [4, null]
  Possible solutions: max(int, int), max(double, double), max(float, float), max(long, long), min(int, int), wait()] with root cause
  Message: No signature of method: static java.lang.Math.max() is applicable for argument types: (java.lang.Integer, null) values: [4, null]
  Possible solutions: max(int, int), max(double, double), max(float, float), max(long, long), min(int, int), wait()
      Line | Method
  -&gt;&gt;  251 | doAppend              in org.apache.log4j.AppenderSkeleton
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  |     66 | appendLoopOnAppenders in org.apache.log4j.helpers.AppenderAttachableImpl
  |    206 | callAppenders . . . . in org.apache.log4j.Category
  |    391 | forcedLog             in     ''
  |    856 | log . . . . . . . . . in     ''
  |    192 | logMessage            in org.slf4j.impl.GrailsLog4jLoggerAdapter
  |    167 | error . . . . . . . . in     ''
  |    213 | error                 in org.apache.commons.logging.impl.SLF4JLog
  |    200 | doFilter . . . . . .  in grails.plugin.cache.web.filter.PageFragmentCachingFilter
  |     63 | doFilter              in grails.plugin.cache.web.filter.AbstractFilter
  |   1145 | runWorker . . . . . . in java.util.concurrent.ThreadPoolExecutor
  |    615 | run                   in java.util.concurrent.ThreadPoolExecutor$Worker
  ^    722 | run . . . . . . . . . in java.lang.Thread
  </code></pre>
  
  <p>So which stacktrace is the correct ?</p>
  
  <p>How can I solve this ?</p>
  
  <p>No stacktrace if I'm not calling save() or validate() message.</p>
  
  <p><strong>Adding failOnError: true did not change the stacktrace.</strong></p>
  
  <p>Making :</p>
  
  <pre><code>if (!offer.save()) {
      log.error offer.errors
  }
  </code></pre>
  
  <p>did not change the stacktrace.</p>
  
  <p>Thanks for reading,</p>
  
  <p>Snite</p>