如何在 Grails 中使用 Quartz 调度器?

How to use Quartz Scheduler in Grails?

我正在使用 Grails 2.3.11,我想在 Grails 应用程序中进行 Quartz 调度。

为此,我添加了两个库 quartz-all-2.1.1.jarc3p0-0.9.1.1.jar 但是当我 运行 项目时它给出了这个错误

DEBUG [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] BasicResourcePool.attemptRefurbishResourceOnCheckin(1616) | A resource could not be refurbished on checkin. [com.mchange.v2.c3p0.impl.NewPooledConnection@5d12d30f]
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
 at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPoolPooledConnectionResourcePoolManager.finerLoggingTestPooledConnection(C3P0PooledConnectionPool.java:324)
 at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPoolPooledConnectionResourcePoolManager.refurbishResourceOnCheckin(C3P0PooledConnectionPool.java:299)
 at com.mchange.v2.resourcepool.BasicResourcePool.attemptRefurbishResourceOnCheckin(BasicResourcePool.java:1606)
 at com.mchange.v2.resourcepool.BasicResourcePool.access0(BasicResourcePool.java:32)
 at com.mchange.v2.resourcepool.BasicResourcePoolRefurbishCheckinResourceTask.run(BasicResourcePool.java:1228)
 at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

关闭日志记录 c3p0 连接池

加载连接池之前添加这一行(在启动调度程序之前)

Properties p = new Properties(System.getProperties());
p.put("com.mchange.v2.log.MLog", "com.mchange.v2.log.FallbackMLog");
p.put("com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL", "OFF"); // Off or any other level
System.setProperties(p);