如何在Grails中使用Quartz Scheduler?

时间:2016-05-13 11:55:54

标签: grails quartz-scheduler

我正在使用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.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.finerLoggingTestPooledConnection(C3P0PooledConnectionPool.java:324)
 at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishResourceOnCheckin(C3P0PooledConnectionPool.java:299)
 at com.mchange.v2.resourcepool.BasicResourcePool.attemptRefurbishResourceOnCheckin(BasicResourcePool.java:1606)
 at com.mchange.v2.resourcepool.BasicResourcePool.access$200(BasicResourcePool.java:32)
 at com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask.run(BasicResourcePool.java:1228)
 at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

1 个答案:

答案 0 :(得分:2)

关闭记录 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);