Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make MySQL work on grails 2.0
    primarykey
    data
    text
    <p>Grails 2.0 seems to have some changes to <code>DataSource.groovy</code> and I don't seem to be able to get mysql running as it was in 1.3.7</p> <p>I did <code>grails install-dependency mysql:mysql-connector-java:5.1.16</code> rather than just dumping the .jar in lib. I hear this is the way to do it these days.</p> <p>Here is what I have replaced in my <code>DataSource.groovy</code>:</p> <pre><code>driverClassName = "org.h2.Driver" ... url = "jdbc:h2:mem:devDb;MVCC=TRUE" </code></pre> <p>With</p> <pre><code>driverClassName = "com.mysql.jdbc.Driver" ... url = "jdbc:mysql://localhost:3306/${dbNamer}?autoreconnect=true" </code></pre> <p>Changing of course the username, password and dbNamer to valid entries... What am I doing wrong? Is there a grails 2.0 tutorial that covers setting up mysql?</p> <p>I get this monster error:</p> <pre><code>| Loading Grails 2.0.0 | Configuring classpath. | Environment set to development..... | Packaging Grails application..... | Compiling 1 source files..... | Running Grails application | Error 2012-01-16 21:39:10,134 [Thread-9] 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.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' 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.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' Line | Method -&gt;&gt; 334 | innerRun in java.util.concurrent.FutureTask$Sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 166 | run in java.util.concurrent.FutureTask | 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor | 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker ^ 679 | 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.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' -&gt;&gt; 334 | innerRun in java.util.concurrent.FutureTask$Sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 166 | run in java.util.concurrent.FutureTask | 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor | 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker ^ 679 | 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.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' -&gt;&gt; 334 | innerRun in java.util.concurrent.FutureTask$Sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 166 | run in java.util.concurrent.FutureTask | 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor | 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker ^ 679 | 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.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' -&gt;&gt; 334 | innerRun in java.util.concurrent.FutureTask$Sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 166 | run in java.util.concurrent.FutureTask | 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor | 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker ^ 679 | run . . . in java.lang.Thread Caused by BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' -&gt;&gt; 334 | innerRun in java.util.concurrent.FutureTask$Sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 166 | run in java.util.concurrent.FutureTask | 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor | 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker ^ 679 | run . . . in java.lang.Thread Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' -&gt;&gt; 334 | innerRun in java.util.concurrent.FutureTask$Sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 166 | run in java.util.concurrent.FutureTask | 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor | 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker ^ 679 | run . . . in java.lang.Thread Caused by SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' -&gt;&gt; 1429 | createConnectionFactory in org.apache.commons.dbcp.BasicDataSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 1371 | createDataSource in '' | 1044 | getConnection in '' | 334 | innerRun in java.util.concurrent.FutureTask$Sync | 166 | run . . . in java.util.concurrent.FutureTask | 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor | 603 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker ^ 679 | run in java.lang.Thread Caused by ClassNotFoundException: com.mysql.jdbc.Driver -&gt;&gt; 217 | run in java.net.URLClassLoader$1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 205 | findClass in java.net.URLClassLoader | 321 | loadClass in java.lang.ClassLoader | 266 | loadClass in '' | 1420 | createConnectionFactory in org.apache.commons.dbcp.BasicDataSource | 1371 | createDataSource in '' | 1044 | getConnection in '' | 334 | innerRun in java.util.concurrent.FutureTask$Sync | 166 | run . . . in java.util.concurrent.FutureTask | 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor | 603 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker ^ 679 | run in java.lang.Thread </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload