20 Jan 2012, 01:54

Bob McNees (1 post)

I’m following along the book and up to the end of chapter 5 everything is working OK. I’ve decided to try and use Grails 2.0, which I’m sure is contributing to some of my woes.

Basically the trouble happens whenever I try to change my DataSource from HSQLDB to MySql. I downloaded the connector jar and put it in the TekDays/lib directory. (the database is running as well)

Every time I try to run the app I get the error:

Caused by ClassNotFoundException: com.mysql.jdbc.Driver

Is anyone else having this problem? I can’t seem to put the MySql connector (mysql-connector-java-5.0.8-bin.jar) in a place where Grails can see it.

Any help is greatly appreciated.

20 Feb 2012, 18:19

Bill Fly (3 posts)

I am also trying to follow the book through with Grails 2.0.1. Be sure you get the latest 2.0.1. Did you see the paragraph on page 96: Now we need to copy mysql-connector-java-5.0.7-bin.jar, which we can get from http://dev.mysql.com/downloads/connector/j/5.0.html, to the TekDays/ lib directory. We also need to create an empty database called tekdays. Grails will create all the tables for us when we run the application for the first time.

Also, I saw this elsewhere: Or, add a runtime dependency in grails-app/conf/BuildConfig.groovy. There will already be one commented out from the default BuildConfig,

dependencies {
    // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.

    runtime 'mysql:mysql-connector-java:5.1.16'
05 Mar 2012, 13:37

Joe Yankel (1 post)

running ‘grails clean’ did the trick for me.

09 Apr 2012, 11:55

Des O Donohoe (1 post)

Has anyone managed to complete Tekdays using Grails 2.0.1 and if so is there an updated e-book link or source code link available?

  You must be logged in to comment