org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'purge' on target class [class org.jasig.portal.events.handlers.db.ExpiredEventsPurger] failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [DELETE FROM stats_render_time srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ?)]; nested exception is 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 'srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ' at line 1

Apereo Issues | Steve Swinsburg | 5 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    We've recently upgraded to the 3.2.5 branch and noticed this SQL error in the logs when the job turns to purge events. INFO [uPortalTaskScheduler_Worker-4] Oct/11 16:43:58,726 db.ExpiredEventsPurger.[] - Purging events before the following date: 10/10/10 ERROR [uPortalTaskScheduler_Worker-4] Oct/11 16:43:58,730 core.JobRunShell.[] - Job DEFAULT.org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean#46e91e2f threw an unhandled Exception: org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'purge' on target class [class org.jasig.portal.events.handlers.db.ExpiredEventsPurger] failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [DELETE FROM stats_render_time srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ?)]; nested exception is 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 'srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ' at line 1 at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:269) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525) Caused by: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [DELETE FROM stats_render_time srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ?)]; nested exception is 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 'srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ' at line 1 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:220) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:792) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:850) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:858) at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.update(SimpleJdbcTemplate.java:237) at org.jasig.portal.events.handlers.db.ExpiredEventsPurger.purge(ExpiredEventsPurger.java:97) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276) at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260) ... 3 more 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 'srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) at com.mysql.jdbc.Util.getInstance(Util.java:384) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2409) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2327) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2312) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:798) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591) ... 14 more

    Apereo Issues | 5 years ago | Steve Swinsburg
    org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'purge' on target class [class org.jasig.portal.events.handlers.db.ExpiredEventsPurger] failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [DELETE FROM stats_render_time srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ?)]; nested exception is 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 'srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ' at line 1
  2. 0

    We've recently upgraded to the 3.2.5 branch and noticed this SQL error in the logs when the job turns to purge events. INFO [uPortalTaskScheduler_Worker-4] Oct/11 16:43:58,726 db.ExpiredEventsPurger.[] - Purging events before the following date: 10/10/10 ERROR [uPortalTaskScheduler_Worker-4] Oct/11 16:43:58,730 core.JobRunShell.[] - Job DEFAULT.org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean#46e91e2f threw an unhandled Exception: org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'purge' on target class [class org.jasig.portal.events.handlers.db.ExpiredEventsPurger] failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [DELETE FROM stats_render_time srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ?)]; nested exception is 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 'srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ' at line 1 at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:269) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525) Caused by: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [DELETE FROM stats_render_time srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ?)]; nested exception is 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 'srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ' at line 1 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:220) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:792) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:850) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:858) at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.update(SimpleJdbcTemplate.java:237) at org.jasig.portal.events.handlers.db.ExpiredEventsPurger.purge(ExpiredEventsPurger.java:97) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276) at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260) ... 3 more 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 'srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) at com.mysql.jdbc.Util.getInstance(Util.java:384) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2409) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2327) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2312) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:798) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591) ... 14 more

    Apereo Issues | 5 years ago | Steve Swinsburg
    org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'purge' on target class [class org.jasig.portal.events.handlers.db.ExpiredEventsPurger] failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [DELETE FROM stats_render_time srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ?)]; nested exception is 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 'srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ' at line 1
  3. 0

    SQL-Script Syntax Error (MySQL, JDBC, Spring)

    java-forum.org | 2 years ago
    org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [DELETE FROM ?]; nested exception is 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 ''TestUnitMainCategory'' at line 1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SQL-Script Syntax Error (MySQL, JDBC, Spring)

    java-forum.org | 1 year ago
    org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [DELETE FROM ?]; nested exception is 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 ''TestUnitMainCategory'' at line 1
  6. 0

    Error com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException

    Stack Overflow | 3 years ago | CODE FISH
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'testspring.user' doesn't exist
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. 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 'srt WHERE srt.event_id IN (SELECT se.id FROM stats_event se WHERE se.act_date < ' at line 1

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0()
  2. Java RT
    Constructor.newInstance
    1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    4. java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    4 frames
  3. MySQL jdbc
    PreparedStatement.executeUpdate
    1. com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
    2. com.mysql.jdbc.Util.getInstance(Util.java:384)
    3. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
    4. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
    5. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
    6. com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
    7. com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
    8. com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
    9. com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113)
    10. com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2409)
    11. com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2327)
    12. com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2312)
    12 frames
  4. Commons DBCP
    DelegatingPreparedStatement.executeUpdate
    1. org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    2. org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    3. org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    3 frames
  5. Spring Framework
    SimpleJdbcTemplate.update
    1. org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:798)
    2. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591)
    3. org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:792)
    4. org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:850)
    5. org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:858)
    6. org.springframework.jdbc.core.simple.SimpleJdbcTemplate.update(SimpleJdbcTemplate.java:237)
    6 frames
  6. org.jasig.portal
    ExpiredEventsPurger.purge
    1. org.jasig.portal.events.handlers.db.ExpiredEventsPurger.purge(ExpiredEventsPurger.java:97)
    1 frame
  7. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  8. Spring Core
    MethodInvoker.invoke
    1. org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)
    1 frame
  9. Spring Context Support
    QuartzJobBean.execute
    1. org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260)
    2. org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
    2 frames
  10. quartz
    SimpleThreadPool$WorkerThread.run
    1. org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    2. org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    2 frames