Search code examples
grailsherokucleardb

Problems setting up Grails 2.3.5 App on Heroku with ClearDB


I am setting up a Grails 2.3.5 App on a Heroku Server and I keep getting the following error when tomcat starts up:

    Caused by: java.sql.SQLException: Driver:com.mysql.jdbc.Driver@5a7359fe returned null for URL:jdbc:h2:mem:grailsDB;MVCC=TRUE;LOCK_TIMEOUT=10000 

I am not using h2 as the Database. I would like to use ClearDB. My environment variables all look correct and everything looks correct in DataSource.groovy. I even setup the connection string to be hard coded to see if this would make a difference. Nada.

    production {
        datasource {
            dbCreate = "create-drop"
            url = "jdbc:mysql://us-cdbr-east-05.cleardb.net/heroku_5a952ab6aXXXXXXX?reconnect=true"

            username = "XXXXX"
            password = "xxxxx"
        }
    }

Obviously I'm missing something, but I cannot see what. Where is the production setup getting the h2 connection string from?!


Solution

  • I found out the reason for my problems. The code block for data source has a lower case "s" in source. It should have been dataSource, not datasource.

    When this block is missing, it appears the default is a h2 database with the name "grailsDB". I could not find this documented anywhere, hence all my confusion.

    Check your cases!!!!