title: Grails 2 and mongodb not working
body: <p>I am using Grails 2.2.0 and MongoDB. I have configured Grails to run against MongoDB instead of the default H2 in memory database. From the error message h2 seems to be involved even though I think I removed it. </p>
  
  <p>My DataSource.groovy: </p>
  
  <pre><code>grails { 
      mongo { 
          host = "localhost" 
          port = 27017 
          databaseName = "physicians" 
      } 
  } 
  </code></pre>
  
  <p>My BuildConfig.groovy: </p>
  
  <pre><code>plugins { 
     runtime ":hibernate:$grailsVersion" 
     runtime ":jquery:1.8.0" 
     runtime ":resources:1.1.6" 
  
     // Uncomment these (or add new ones) to enable additional resources capabilities 
     //runtime ":zipped-resources:1.0" 
     //runtime ":cached-resources:1.0" 
     //runtime ":yui-minify-resources:0.1.4" 
  
     build ":tomcat:$grailsVersion" 
  
     runtime ":database-migration:1.1" 
  
     compile ':cache:1.0.0' 
     compile ':mongodb:1.1.0.GA' 
  } 
  </code></pre>
  
  <p>The error I get when i want to save a domain object Artist is: </p>
  
  <pre><code>| Error 2013-01-03 22:33:18,881 [http-bio-9090-exec-1] ERROR util.JDBCExceptionReporter  - Table "ARTIST" not found; SQL statement: 
  insert into artist (id, version, artist_name, birth_name) values (null, ?, ?, ?) [42102-164] 
  | Error 2013-01-03 22:33:19,050 [http-bio-9090-exec-1] ERROR errors.GrailsExceptionResolver  - JdbcSQLException occurred when processing request: [GET] /musicstack/artist/ 
  Table "ARTIST" not found; SQL statement: 
  insert into artist (id, version, artist_name, birth_name) values (null, ?, ?, ?) [42102-164]. Stacktrace follows: 
  Message: Table "ARTIST" not found; SQL statement: 
  insert into artist (id, version, artist_name, birth_name) values (null, ?, ?, ?) [42102-164] 
      Line | Method 
  -&gt;&gt;  329 | getJdbcSQLException in org.h2.message.DbException 
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  |    169 | get                 in     '' 
  |    146 | get . . . . . . . . in     '' 
  |   4753 | readTableOrView     in org.h2.command.Parser 
  |   4731 | readTableOrView . . in     '' 
  |    954 | parseInsert         in     '' 
  |    375 | parsePrepared . . . in     '' 
  |    279 | parse               in     '' 
  |    251 | parse . . . . . . . in     '' 
  |    217 | prepareCommand      in     '' 
  |    415 | prepareLocal . . .  in org.h2.engine.Session 
  |    364 | prepareCommand      in     '' 
  |   1121 | prepareCommand . .  in org.h2.jdbc.JdbcConnection 
  |     71 | &lt;init&gt;              in org.h2.jdbc.JdbcPreparedStatement 
  |    267 | prepareStatement .  in org.h2.jdbc.JdbcConnection 
  |   1051 | prepareStatement    in     '' 
  |    508 | prepareStatement .  in org.apache.commons.dbcp.DelegatingConnection 
  |    400 | prepareStatement    in org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper 
  |      7 | index . . . . . . . in musicstack.ArtistController 
  |    195 | doFilter            in grails.plugin.cache.web.filter.PageFragmentCachingFilter 
  |     63 | doFilter . . . . .  in grails.plugin.cache.web.filter.AbstractFilter 
  |    886 | runTask             in java.util.concurrent.ThreadPoolExecutor$Worker 
  |    908 | run . . . . . . . . in     '' 
  ^    680 | run                 in java.lang.Thread 
  </code></pre>
  
  <p>What am I missing here? </p>
  
  <p>Best regards /Lasse</p>
  
  <p>====================================</p>
  
  <p>Got it working.</p>
  
  <p>First I had to remove the line </p>
  
  <pre><code>runtime ":hibernate:$grailsVersion" 
  </code></pre>
  
  <p>from the BuildConfig.groovy</p>
  
  <p>When I did that I got this:</p>
  
  <pre><code>| Error Fatal error during compilation org.apache.tools.ant.BuildException: 
  java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
  (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
  </code></pre>
  
  <p>I then removed the line</p>
  
  <pre><code>runtime ":database-migration:1.1" 
  </code></pre>
  
  <p>from BuildConfig.groovy</p>
  
  <p>This last part was not found when searching to solve this problem. Is this the way it is supposed to be done?</p>
  
  <p>/Lasse</p>