quartz 오류 보고: OPTION SQL_SELECT_LIMIT=1
3295 단어 개인 경험
[2017-11-30 09:13:49.366][ERROR][ErrorLogger.schedulerError] An error occurred while scanning for the next triggers to fire.
org.quartz.JobPersistenceException: Couldn't acquire next trigger: 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 'OPTION SQL_SELECT_LIMIT=1' at line 1 [See nested exception: 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 'OPTION SQL_SELECT_LIMIT=1' at line 1]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2840)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$41.execute(JobStoreSupport.java:2755)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3811)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2751)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:264)
Caused by: 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 'OPTION SQL_SELECT_LIMIT=1' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2536)
at com.mysql.jdbc.StatementImpl.executeSimpleNonQuery(StatementImpl.java:1463)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1872)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectTriggerToAcquire(StdJDBCDelegate.java:2571)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2781)
해결 방법
mysql mysql-connector-java 5.1.6
msql 드라이브를 5.1.6에서 5.1.44로 변경하면 됩니다.
mysql mysql-connector-java 5.1.44
원인:
프로젝트에서 제가 사용하는 jdbc 드라이브 버전
mysql-connector-java-5.1.15.jar
mysql 데이터베이스 버전 5.6
jdbc는 데이터베이스에 연결할 때 테스트 문구 SET OPTION SQL_를 보냅니다.SELECT_LIMIT=DEFAULT
이것은 mysql5.6 이하 버전에서는 가능하지만, 5.6은 더 이상 SET를 지원하지 않습니다.
해결:
드라이브 버전을 업그레이드해서 mysql-connector-java-5.1.25로 바꿨습니다.jar 문제 해결
--------------------
참고: 버전이 일치해야 합니다. 그렇지 않으면 오류가 발생합니다.
저자: ym563099457 출처: CSDN 원문:https://blog.csdn.net/ym563099457/article/details/78672962판권 성명: 본고는 블로거의 오리지널 문장입니다. 전재하려면 블로거 링크를 첨부하세요!