title: Grails Message: No such property: for class: solutions:
body: <p>I implement a java domain class for Grails, just described in Docs here: <a href="http://docs.grails.org/latest/guide/hibernate.html" rel="nofollow">http://docs.grails.org/latest/guide/hibernate.html</a></p>
  
  <pre><code>package foo.bar;
  
  import java.util.List;
  
  import javax.persistence.Column;
  import javax.persistence.ElementCollection;
  import javax.persistence.Entity;
  import javax.persistence.Id;
  import javax.persistence.GeneratedValue;
  
  
  
  @Entity
  public class A {
  
       @Id 
       @GeneratedValue
       private Long id;
  
       @ElementCollection
       private List&lt;String&gt; buz;
  
  
       public Long getId() {
          return id;
       }
  
      public void setId(Long id) {
          this.id = id;
      }
  
  
       public void setBuz(List&lt;String&gt; buz) {
           this.buz = buz;
       }
  
       public List&lt;String&gt; getBuz() {
           return buz;
       }
  }
  </code></pre>
  
  <p>And busines code throwing exception:</p>
  
  <pre><code>def list = A.findAll()
  list.each {
      if (it.buz.contains("foobar")) {
          result = it
  }
  </code></pre>
  
  <p>it.buz - throwing exception: Grails Message: </p>
  
  <blockquote>
    <p>No such property: buz for class: foo.bar.A Possible solutions: buz.</p>
  </blockquote>
  
  <p>When I call A.getBuz() directly catch exception: </p>
  
  <blockquote>
    <p>Error 2016-07-27 16:51:39,060 [http-bio-8080-exec-1] ERROR errors.GrailsExceptionResolver  - MissingMethodException occurred when processing request: [GET] /
    No signature of method: static foo.bar.A.getBuz() is applicable for argument types: () values: []
    Possible solutions: getBuz(), setBuz(java.util.List), getClass().</p>
  </blockquote>
  
  <p>Can't understand, why Grails search for <em>static</em> method getBuz()?
  Why invoking by property doesn't work?</p>