title: Getting unknown error while running an Grails 2.1.1 application using grials run-app
body: <p>I am getting Hibernate error of not able to create the required bean while running a Grails 2.1.1 app using grails run-app command.</p>
  
  <p>The stack trace of the error is given below:</p>
  
  <blockquote>
    <p>Loading Grails 2.1.1 | Configuring classpath. | Environment set to
    development..... | Packaging Grails application.... | Compiling 1
    source files | Compiling 1 source files..... | Running Grails
    application Configuring Spring Security UI ... ... finished
    configuring Spring Security UI Configuring Spring Security Core ...
    ... finished configuring Spring Security Core Configuring Spring
    Security ACL ... ... finished configuring Spring Security ACL
    Configuring Spring Security Twitter ... ... finished configuring
    Spring Security Twitter</p>
    
    <p>| Error 2013-08-30 16:24:31,120 [localhost-startStop-1] ERROR
    context.GrailsContextLoader  - Error executing bootstraps: 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:
    <strong>Could not determine Hibernate dialect for database name [H2]!</strong></p>
    
    <p>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': <strong>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]!</strong>
                Line | Method
            ->>  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]!</p>
  
  <pre><code>-&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
  </code></pre>
    
    <p>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]!</p>
  </blockquote>
  
  <p><strong>Settings of my <em>DataBaseConfig</em>.groovy is as below:</strong></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'
  }
  
      // environment specific settings
    environments {
  
  development {
      dataSource {
          dbCreate = "update"
          url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
      }
  }
  test {
      dataSource {
          dbCreate = "update"
          url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
      }
  }
  production {
      dataSource {
          dbCreate = "update"
          url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
      }
  }
  </code></pre>
  
  <p>An early response is really appreciated.</p>
  
  <p>Thanks</p>