org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [DELETE FROM SPRING_SESSION WHERE LAST_ACCESS_TIME < ?]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.spring_session' doesn't exist

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Bunch of Errors after I run my Code
    via Stack Overflow by user962206
    ,
  • MySQL server configuration issues
    via by Unknown author,
  • SQL exception & stacktrace
    via GitHub by mibby
    ,
  • Cannot create a table in MySQL using Java
    via Stack Overflow by david zhao
    ,
  • Hibernate exception when create table
    via Stack Overflow by xorgx3
    ,
    • org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [DELETE FROM SPRING_SESSION WHERE LAST_ACCESS_TIME < ?]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.spring_session' doesn't exist at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:649)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:870)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:931)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:941)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.session.jdbc.JdbcOperationsSessionRepository$6.doInTransaction(JdbcOperationsSessionRepository.java:481)[spring-session-1.2.1.RELEASE.jar:na] at org.springframework.session.jdbc.JdbcOperationsSessionRepository$6.doInTransaction(JdbcOperationsSessionRepository.java:478)[spring-session-1.2.1.RELEASE.jar:na] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)[spring-tx-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.session.jdbc.JdbcOperationsSessionRepository.cleanUpExpiredSessions(JdbcOperationsSessionRepository.java:478)[spring-session-1.2.1.RELEASE.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_45] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_45] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_45] at java.lang.reflect.Method.invoke(Method.java:497)[na:1.8.0_45] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[na:1.8.0_45] at java.util.concurrent.FutureTask.run(FutureTask.java:266)[na:1.8.0_45] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[na:1.8.0_45] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[na:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_45] at java.lang.Thread.run(Thread.java:745)[na:1.8.0_45] Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.spring_session' doesn't exist at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[na:1.8.0_45] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[na:1.8.0_45] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[na:1.8.0_45] at java.lang.reflect.Constructor.newInstance(Constructor.java:422)[na:1.8.0_45] at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)[mysql-connector-java-5.1.39.jar:5.1.39] at com.mysql.jdbc.Util.getInstance(Util.java:387)[mysql-connector-java-5.1.39.jar:5.1.39] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:942)[mysql-connector-java-5.1.39.jar:5.1.39] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)[mysql-connector-java-5.1.39.jar:5.1.39] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)[mysql-connector-java-5.1.39.jar:5.1.39] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)[mysql-connector-java-5.1.39.jar:5.1.39] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)[mysql-connector-java-5.1.39.jar:5.1.39] at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)[mysql-connector-java-5.1.39.jar:5.1.39] at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)[mysql-connector-java-5.1.39.jar:5.1.39] at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)[mysql-connector-java-5.1.39.jar:5.1.39] at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2009)[mysql-connector-java-5.1.39.jar:5.1.39] at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5098)[mysql-connector-java-5.1.39.jar:5.1.39] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1994)[mysql-connector-java-5.1.39.jar:5.1.39] at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:877)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:870)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:633)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE] ... 21 more

    Users with the same issue

    rocday
    rocday2 times, last one,
    dafman
    dafman2 times, last one,
    slash
    slash1 times, last one,
    jf-ast
    jf-ast1 times, last one,
    aidoan
    aidoan2 times, last one,
    115 more bugmates