Grails与MySQL抛出错误

时间:2012-05-22 13:26:06

标签: mysql grails

我正在尝试使用带Grails的MySQL ..根据Grails的文档,我已经下载了MySQL连接器并将jar文件放在路径grails-app / lib。

但是在运行应用程序时,我遇到了很多错误。其中一些如下,我认为如果解决可以解决其余的问题。

| Loading Grails 2.0.3
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application.....
| Compiling 236 source files.
| Error Compilation error: startup failed:
Compile error during compilation with javac.
C:\xp\sst workspace\racetrack\grails-app\lib\src\com\mysql\jdbc\integration\c3p0\MysqlConnectionTester.java:31: error: package com.mchange.v2.c3p0 does not exist
import com.mchange.v2.c3p0.C3P0ProxyConnection;
                          ^
C:\xp\sst workspace\racetrack\grails-app\lib\src\com\mysql\jdbc\integration\c3p0\MysqlConnectionTester.java:32: error: package com.mchange.v2.c3p0 does not exist
import com.mchange.v2.c3p0.QueryConnectionTester;
                          ^
C:\xp\sst workspace\racetrack\grails-app\lib\src\com\mysql\jdbc\integration\c3p0\MysqlConnectionTester.java:44: error: cannot find symbol
public final class MysqlConnectionTester implements QueryConnectionTester {
                                                    ^
  symbol: class QueryConnectionTester
C:\xp\sst workspace\racetrack\grails-app\lib\src\com\mysql\jdbc\integration\jboss\ExtendedMysqlExceptionSorter.java:28: error: package org.jboss.resource.adapter.jdbc.vendor does not exist
import org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter;
                                             ^
.......... etc
44 errors
2 warnings
1 error

请帮我解决这个问题...

1 个答案:

答案 0 :(得分:0)

  1. 文档在哪里说grails-app/lib?我认为它应该只是lib/
  2. 你确定你把二进制jar放在那里,而不是某种源代码jar吗?
  3. 您应该移除grails-app内所做的任何内容,然后只需取消注释该行:

        // runtime 'mysql:mysql-connector-java:5.1.16'
    
    grails-app/conf/BuildConfig.groovy

    中的