title: How can I make use of the class annotated with @grails.persistence.Entity in the jar
body: <p>In my grails project, I want to use the domain class in the common jar file with the @grails.persistence.Entity annotation. but when I follow the step in the  <a href="http://grails.org/doc/latest/guide/hibernate.html#mappingWithHibernateAnnotations" rel="nofollow">doc from grails site</a></p>
  
  <p>I add hibernate.cfg.xml which like</p>
  
  <pre><code>&lt;!DOCTYPE hibernate-configuration SYSTEM
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
          &lt;mapping package="com.books" /&gt;
          &lt;mapping class="com.books.Book" /&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>to grails-app/conf/hibernate/ directory.
  but when I start the project, it report the error log:</p>
  
  <pre><code>2013-04-11 14:24:53,928 - org.codehaus.groovy.grails.web.context.GrailsContextLoader -20516 [pool-5-thread-1] ERROR  - Error executing bootstraps: groovy.lang.MissingMethodException: No signature of method: static com.baoxian.task.inscar.entity.QuoteTask.findById() is applicable for argument types: (java.lang.Long) values: [2851]
  Possible solutions: find(), findAll(), findAll(groovy.lang.Closure), find(groovy.lang.Closure)
  org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: static com.baoxian.task.inscar.entity.QuoteTask.findById() is applicable for argument types: (java.lang.Long) values: [2851]
  Possible solutions: find(), findAll(), findAll(groovy.lang.Closure), find(groovy.lang.Closure)
      at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:300)
      at grails.util.Environment.executeForEnvironment(Environment.java:293)
      at grails.util.Environment.executeForCurrentEnvironment(Environment.java:269)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
  Caused by: groovy.lang.MissingMethodException: No signature of method: static com.baoxian.task.inscar.entity.QuoteTask.findById() is applicable for argument types: (java.lang.Long) values: [2851]
  Possible solutions: find(), findAll(), findAll(groovy.lang.Closure), find(groovy.lang.Closure)
      at BootStrap$_closure1.doCall(BootStrap.groovy:22)
      ... 8 more
  Disconnected from the target VM, address: '127.0.0.1:63383', transport: 'socket'
  
  Process finished with exit code 1
  </code></pre>
  
  <p>It becomes obvious that the @Entity does not work.
  besides, my BuildConfig.groovy likes:</p>
  
  <pre><code>compile ('com.baoxian:baoxian-task-inscar-manager:1.2.5-SNAPSHOT')
                  {
                      excludes "org.grails", "org.slf4j", "xml-apis","mysql","org.hibernate","hsqldb","hibernate-annotations","org.quartz-scheduler","org.springframework"
                  }
  </code></pre>
  
  <p>the com.baoxian:baoxian-task-inscar-manager:1.2.5-SNAPSHOT is just where my domain class from</p>
  
  <p>it's the first time I ask question on the stackoverflow . ^_^</p>