Announcement Announcement Module
Collapse
No announcement yet.
Massive error on grails run-app Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Massive error on grails run-app

    Hello all. I'm new to grails and I have been playing with a dev project on my local machine. After some unsuccessful and apparently ill advised attempts to import data to my project's HSQLDB I got the following from the Stack trace upon running the grails run-app command:




    Running Grails application..
    loading security config ...
    2010-11-17 16:18:51,428 [main] ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.sp
    ringframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; n
    ested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean pr
    operty 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialec
    tDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'dialectDet
    ector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessExc eption: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.
    dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (User not found: SA)
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreatio
    nException: 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 ex
    ception is org.springframework.beans.factory.BeanCreationExce ption: 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.BeanCreationExce ption: Error creating bean with name 'dialectDetector': Invocation of init method faile
    d; nested exception is org.springframework.jdbc.support.MetaDataAccessExc eption: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create
    PoolableConnectionFactory (User not found: SA)
    at org.grails.tomcat.TomcatServer.start(TomcatServer. groovy:164)
    at grails.web.container.EmbeddableServer$start.call(U nknown Source)
    at _GrailsRun_groovy$_run_closure5_closure12.doCall(_ GrailsRun_groovy:158)
    at _GrailsRun_groovy$_run_closure5_closure12.doCall(_ GrailsRun_groovy)
    at _GrailsSettings_groovy$_run_closure10.doCall(_Grai lsSettings_groovy:280)
    at _GrailsSettings_groovy$_run_closure10.call(_Grails Settings_groovy)
    at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_ groovy:149)
    at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_gr oovy)
    at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116)
    at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groo vy)
    at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_ groovy:59)
    at RunApp$_run_closure1.doCall(RunApp:33)
    at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:38 1)
    at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:41 5)
    at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
    at gant.Gant.withBuildListeners(Gant.groovy:427)
    at gant.Gant.this$2$withBuildListeners(Gant.groovy)
    at gant.Gant$this$2$withBuildListeners.callCurrent(Un known Source)
    at gant.Gant.dispatch(Gant.groovy:415)
    at gant.Gant.this$2$dispatch(Gant.groovy)
    at gant.Gant.invokeMethod(Gant.groovy)
    at gant.Gant.executeTargets(Gant.groovy:590)
    at gant.Gant.executeTargets(Gant.groovy:589)
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 's
    essionFactory'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' whil
    e setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'hibernateProperties': Cannot resolve referenc
    e to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with
    name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessExc eption: Error while extracting DatabaseMetaData; nested exception is or
    g.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (User not found: SA)
    ... 23 more
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property '
    hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetecto
    r' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'dialectDetector':
    Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessExc eption: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQL
    NestedException: Cannot create PoolableConnectionFactory (User not found: SA)
    ... 23 more
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: 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.BeanCreationExce ption: Error creating bean with name 'dialectDetector': Invocation of init method faile
    d; nested exception is org.springframework.jdbc.support.MetaDataAccessExc eption: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create
    PoolableConnectionFactory (User not found: SA)
    ... 23 more
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.supp
    ort.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (User not found: SA)
    ... 23 more
    Caused by: org.springframework.jdbc.support.MetaDataAccessExc eption: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConn
    ectionFactory (User not found: SA)
    ... 23 more
    Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (User not found: SA)
    at org.apache.commons.dbcp.BasicDataSource.createData Source(BasicDataSource.java:1225)
    at org.apache.commons.dbcp.BasicDataSource.getConnect ion(BasicDataSource.java:880)
    at $Proxy10.getMetaData(Unknown Source)
    ... 23 more
    Caused by: java.sql.SQLException: User not found: SA
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
    at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
    at org.hsqldb.jdbcDriver.connect(Unknown Source)
    at org.apache.commons.dbcp.DriverConnectionFactory.cr eateConnection(DriverConnectionFactory.java:38)
    at org.apache.commons.dbcp.PoolableConnectionFactory. makeObject(PoolableConnectionFactory.java:294)
    at org.apache.commons.dbcp.BasicDataSource.validateCo nnectionFactory(BasicDataSource.java:1247)
    at org.apache.commons.dbcp.BasicDataSource.createData Source(BasicDataSource.java:1221)
    ... 25 more


    Thanks in advance.

  • #2
    Looks like usernames are case-sensitive in HSQLDB - try changing the username to 'sa' in DataSource.groovy - according to the stack trace you're trying to connect as 'SA'.

    Comment


    • #3
      Burt, Thanks for your quick reply.

      In the DataSource.groovy the username was set to 'sa' I changed it to 'SA' but still got the same error.

      I also have a connection to the database through DbVisualizer. This connection has not been working since getting the error on grails run-app.

      Comment


      • #4
        Can you post your DataSource.groovy? The jdbc url is probably bad.

        Comment


        • #5
          dataSource {
          pooled = true
          driverClassName = "org.hsqldb.jdbcDriver"
          username = "sa"
          password = ""
          }
          hibernate {
          cache.use_second_level_cache = true
          cache.use_query_cache = true
          cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
          }
          // environment specific settings
          environments {
          development {
          dataSource {
          dbCreate = "update" // one of 'create', 'create-drop','update'
          url = "jdbc:hsqldb:file:devDb;shutdown=true"
          }
          }
          test {
          dataSource {
          dbCreate = "update"
          url = "jdbc:hsqldb:mem:testDb"
          }
          }
          production {
          dataSource {
          dbCreate = "update"
          url = "jdbc:hsqldb:filerodDb;shutdown=true"
          }
          }
          }

          Comment


          • #6
            Looks like you removed the 'sa' user from your database - edit devDb.script and add the create user and grant statements, it should look something like this:

            Code:
            CREATE SCHEMA PUBLIC AUTHORIZATION DBA
            ...
            <create/alter table statements and inserts>
            ...
            CREATE USER SA PASSWORD ""
            GRANT DBA TO SA
            SET WRITE_DELAY 10

            Comment


            • #7
              Thanks Burt! That fixed my compile problem. Unfortunately I lost all the data in my database. Good thing this was only a dev project!

              When I opened the devDb.script the only thing in it was:

              CREATE SCHEMA PUBLIC AUTHORIZATION DBA
              SET WRITE_DELAY 10

              Do you know what could have blanked out the entire script?

              Comment

              Working...
              X