title: Error trying to run a Grails app
body: <p>I'm new with Grails, I installed it with the GVM tool and I'm trying to run a default application from a terminal, just try this commands: grails create-app demo and then grails run-app, I'm getting a massive error:</p>
  
  <pre><code>| Running Grails application
  | Error 2013-12-02 02:41:59,628 [localhost-startStop-1] ERROR context.GrailsContextLoader  - Error initializing the application: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
  Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
      Line | Method
  -&gt;&gt;  334 | innerRun  in java.util.concurrent.FutureTask$Sync
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  |    166 | run       in java.util.concurrent.FutureTask
  |   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
  |    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
  ^    724 | run . . . in java.lang.Thread
  Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
  -&gt;&gt;  334 | innerRun  in java.util.concurrent.FutureTask$Sync
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  |    166 | run       in java.util.concurrent.FutureTask
  |   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
  |    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
  ^    724 | run . . . in java.lang.Thread
  Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
  -&gt;&gt;  334 | innerRun  in java.util.concurrent.FutureTask$Sync
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  |    166 | run       in java.util.concurrent.FutureTask
  |   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
  |    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
  ^    724 | run . . . in java.lang.Thread
  Caused by BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
  -&gt;&gt;  334 | innerRun  in java.util.concurrent.FutureTask$Sync
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  |    166 | run       in java.util.concurrent.FutureTask
  |   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
  |    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
  ^    724 | run . . . in java.lang.Thread
  Caused by BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
  -&gt;&gt;  334 | innerRun  in java.util.concurrent.FutureTask$Sync
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  |    166 | run       in java.util.concurrent.FutureTask
  |   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
  |    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
  ^    724 | run . . . in java.lang.Thread
  Caused by CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
  -&gt;&gt;  334 | innerRun  in java.util.concurrent.FutureTask$Sync
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  |    166 | run       in java.util.concurrent.FutureTask
  |   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
  |    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
  ^    724 | run . . . in java.lang.Thread
  | Error Forked Grails VM exited with error
  | Server running. Browse to http://localhost:8080/demo
  </code></pre>
  
  <p>My java version:</p>
  
  <pre><code>java version "1.7.0_25"
  OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.13.04.2)
  OpenJDK Server VM (build 23.7-b01, mixed mode)
  </code></pre>
  
  <p>My grails version:</p>
  
  <pre><code>Grails version: 2.3.3
  </code></pre>
  
  <p>Also, there's the DataSource.groovy for the default application that i'm trying to run</p>
  
  <pre><code>dataSource {
      pooled = true
      driverClassName = "org.h2.Driver"
      username = "sa"
      password = ""
  }
  hibernate {
      cache.use_second_level_cache = true
      cache.use_query_cache = false
      cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
  //    cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
  }
  
  // environment specific settings
  environments {
      development {
          dataSource {
              dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
              url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
          }
      }
      test {
          dataSource {
              dbCreate = "update"
              url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
          }
      }
      production {
          dataSource {
              dbCreate = "update"
              url = "jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
              properties {
                 maxActive = -1
                 minEvictableIdleTimeMillis=1800000
                 timeBetweenEvictionRunsMillis=1800000
                 numTestsPerEvictionRun=3
                 testOnBorrow=true
                 testWhileIdle=true
                 testOnReturn=false
                 validationQuery="SELECT 1"
                 jdbcInterceptors="ConnectionState"
              }
          }
      }
  } 
  </code></pre>
  
  <p><strong>EDIT:</strong>
  Problem solved, just upgrade the JDK version.</p>