at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:760)
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
at com.lk.ActivemqApplication.main(ActivemqApplication.java:12)
Caused by: org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: 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 'AS SELECT queue_message_entity WHERE `insert_time` < '1970-01-01 08:00:55'' at line 1
### The error may exist in com/lk/loms/mq/service/dao/mapper/HistoryMsgMapper.java (best guess)
### The error may involve com.lk.loms.mq.service.dao.mapper.HistoryMsgMapper.insertQueueBackup-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO queue_message_entity_bak AS SELECT queue_message_entity WHERE `insert_time` < ?
### Cause: 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 'AS SELECT queue_message_entity WHERE `insert_time` < '1970-01-01 08:00:55'' at line 1
; bad SQL grammar []; 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 'AS SELECT queue_message_entity WHERE `insert_time` < '1970-01-01 08:00:55'' at line 1
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
at com.sun.proxy.$Proxy120.selectOne(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:83)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
at com.sun.proxy.$Proxy121.insertQueueBackup(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy123.insertQueueBackup(Unknown Source)
at com.lk.BackupCommandLineRunner.insertQueueBackup(BackupCommandLineRunner.java:61)
at com.lk.BackupCommandLineRunner.run(BackupCommandLineRunner.java:27)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:776)
... 6 common frames omitted
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 'AS SELECT queue_message_entity WHERE `insert_time` < '1970-01-01 08:00:55'' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.Util.getInstance(Util.java:408)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)

其实是很简单的,  下面的语句中多了个as, 不应该的.

INSERT INTO queue_message_entity_bak AS SELECT queue_message_entity WHERE `insert_time` < ?

本来就是简单的sql 语法错误, 还以为是日期格式问题, 搞了几个小时, 也是郁闷了. 原因还是不够细心, 没注意到 BadSqlGrammarException 这个提示.

最新文章

  1. JavaScript随笔6
  2. 【.NET深呼吸】动态类型(扩充篇)
  3. oracle基本操作符/运算符/操作语言
  4. 国内技术管理人员批阅google的“春运交通图”项目(大公司下的高效率)&lt;转载&gt;
  5. Ansible-Tower快速入门-8.创建组织【翻译】
  6. 转:python signal信号
  7. lumen可以使用laravel-ide-helper
  8. ASP.NET 连接MySQL数据库 详细步骤
  9. [转载]C#中的WebBrowser控件的使用
  10. 记录一次centos升级gblic的教训
  11. 远程仓库版本回退方法 good
  12. 用Ueditor存入数据库带HTML标签的文本,从数据库取出来后,anjular用ng-bind-html处理带HTML标签的文本
  13. phpcms 2008和discuz X3.1实现同步登陆退出论坛(已实现)
  14. php随笔2-php+ajax 实现输入读取数据库显示匹配信息
  15. 例10-10 uva10491(简单概率)
  16. 【Vue 2.x】指令的学习
  17. 解决vscode无法提示golang的问题
  18. 微信H5开发
  19. Python Day 5
  20. Redis 可视化界面工具:Fastoredis

热门文章

  1. 用canvas画一个房子
  2. python基础07_tuple_dict
  3. 前端-URL到页面显示的全过程
  4. ecmall 移动端 微信分享
  5. java基础(1)IntelliJ IDEA入门和数组操作 解决idea启动速度慢--配置JVM
  6. Parsing Natural Scenes and Natural Language with Recursive Neural Networks-paper
  7. Linux 练习题(2)
  8. 基于tensorflow的简单线性回归模型
  9. Python开发 基礎知識 2.變量 ( *arg, **kwargs )
  10. 使用rpm 打包开发的postgres extension