Unknown column 'xx' in 'field list'
2021-03-03 00:27:26.695 [DubboServerHandler-10.13.195.48:20880-thread-200] [com.melon.contract.biz.bean.dubbo.ContractExecServiceImpl] [TID:4231f5f5aed73371] -
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'line_num' in 'field list'
### The error may exist in URL [jar:file:/web/servers/tomcat/webapps/ROOT/WEB-INF/lib/contract-dao-0.0.1.jar!/mybatis/sharding/ContractExcelDataDOMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT id, element_no, element_name, element_value_id, agreement_id, agreement_no, agreement_detail_id, line_num, values_json, created, modified, yn FROM agreement_excel_000 AND element_no = ? AND yn = 1 AND values_json IS NOT NULL
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'line_num' in 'field list'
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'line_num' in 'field list'
org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'line_num' in 'field list'
### The error may exist in URL [jar:file:/web/servers/tomcat/webapps/ROOT/WEB-INF/lib/contract-dao-0.0.1.jar!/mybatis/sharding/ContractExcelDataDOMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT id, element_no, element_name, element_value_id, agreement_id, agreement_no, agreement_detail_id, line_num, values_json, created, modified, yn FROM agreement_excel_000 AND element_no = ? AND yn = 1 AND values_json IS NOT NULL
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'line_num' in 'field list'
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'line_num' in 'field list'
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:234) ~[spring-jdbc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) ~[spring-jdbc-5.0.8.RELEASE.jar:5.0.8.RELEASE]
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) ~[mybatis-spring-1.3.2.jar:1.3.2]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) ~[mybatis-spring-1.3.2.jar:1.3.2]
at com.sun.proxy.$Proxy42.selectList(Unknown Source) ~[na:na]
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230) ~[mybatis-spring-1.3.2.jar:1.3.2]
at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:139) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:76) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) ~[mybatis-3.4.6.jar:3.4.6]
at com.sun.proxy.$Proxy53.selectByElementNo(Unknown Source) ~[na:na]
at com.melon.contract.service.bean.impl.ContractExcelDataServiceImpl.selectByElementNo(ContractExcelDataServiceImpl.java:98) ~[contract-service-0.0.1.jar:na]
at com.melon.contract.service.bean.impl.ContractExcelDataServiceImpl.selectByElementNoAndDate(ContractExcelDataServiceImpl.java:105) ~[contract-service-0.0.1.jar:na]
at com.melon.contract.biz.bean.bo.rebate.impl.JoinListSurpassParser.getExcelData(JoinListSurpassParser.java:19) ~[contract-biz-0.0.1.jar:na]
at com.melon.contract.biz.bean.bo.rebate.impl.ExcelDataParser.getValueMap(ExcelDataParser.java:38) ~[contract-biz-0.0.1.jar:na]
at com.melon.contract.biz.bean.bo.rebate.AbstractParser.parse(AbstractParser.java:68) ~[contract-biz-0.0.1.jar:na]
at com.melon.contract.biz.bean.dubbo.ContractExecServiceImpl.parse(ContractExecServiceImpl.java:110) [contract-biz-0.0.1.jar:na]
at com.melon.contract.biz.bean.dubbo.ContractExecServiceImpl.lambda$findRebateInfoByContractNo$43(ContractExecServiceImpl.java:87) [contract-biz-0.0.1.jar:na]
at com.melon.contract.biz.bean.dubbo.ContractExecServiceImpl.handler(ContractExecServiceImpl.java:206) [contract-biz-0.0.1.jar:na]
at com.melon.contract.biz.bean.dubbo.ContractExecServiceImpl.findRebateInfoByContractNo(ContractExecServiceImpl.java:85) [contract-biz-0.0.1.jar:na]
at org.apache.dubbo.common.bytecode.Wrapper23.invokeMethod(Wrapper23.java) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:94) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.config.invoker.DelegateProviderMetaDataInvoker.invoke(DelegateProviderMetaDataInvoker.java:56) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:63) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:74) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.monitor.support.MonitorFilter.invoke$original$z5msq23n(MonitorFilter.java:91) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.monitor.support.MonitorFilter.invoke$original$z5msq23n$accessor$TvWtP8Pk(MonitorFilter.java) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.monitor.support.MonitorFilter$auxiliary$VcfLiUoi.call(Unknown Source) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:92) [dsw-agent.jar:na]
at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:74) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:54) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:74) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:81) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:74) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.filter.GlobalParameterProviderFilter.invoke(GlobalParameterProviderFilter.java:27) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:74) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:87) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:74) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:191) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:74) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:74) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:40) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:74) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:134) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:103) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:200) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57) [dsf-sdk-2.7.2-20210120.140436-81.jar:2.7.2-SNAPSHOT]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_191]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_191]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'line_num' in 'field list'
at sun.reflect.GeneratedConstructorAccessor320.newInstance(Unknown Source) ~[na:na]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_191]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_191]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[mysql-connector-java-5.1.48.jar:5.1.48]
at com.mysql.jdbc.Util.getInstance(Util.java:408) ~[mysql-connector-java-5.1.48.jar:5.1.48]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944) ~[mysql-connector-java-5.1.48.jar:5.1.48]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3933) ~[mysql-connector-java-5.1.48.jar:5.1.48]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3869) ~[mysql-connector-java-5.1.48.jar:5.1.48]
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524) ~[mysql-connector-java-5.1.48.jar:5.1.48]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2675) ~[mysql-connector-java-5.1.48.jar:5.1.48]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465) ~[mysql-connector-java-5.1.48.jar:5.1.48]
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1912) ~[mysql-connector-java-5.1.48.jar:5.1.48]
at com.mysql.jdbc.PreparedStatement.execute$original$dzhNDOEg(PreparedStatement.java:1251) ~[mysql-connector-java-5.1.48.jar:5.1.48]
at com.mysql.jdbc.PreparedStatement.execute$original$dzhNDOEg$accessor$UlEvO4Sx(PreparedStatement.java) ~[mysql-connector-java-5.1.48.jar:5.1.48]
at com.mysql.jdbc.PreparedStatement$auxiliary$xmuYCiGX.call(Unknown Source) ~[mysql-connector-java-5.1.48.jar:5.1.48]
at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:92) [dsw-agent.jar:na]
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java) ~[mysql-connector-java-5.1.48.jar:5.1.48]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498) ~[druid-1.1.9.jar:1.1.9]
at io.shardingsphere.shardingjdbc.executor.SQLExecuteCallbackFactory$2.executeSQL(SQLExecuteCallbackFactory.java:63) ~[sharding-jdbc-core-3.1.0.jar:na]
at io.shardingsphere.shardingjdbc.executor.SQLExecuteCallbackFactory$2.executeSQL(SQLExecuteCallbackFactory.java:59) ~[sharding-jdbc-core-3.1.0.jar:na]
at io.shardingsphere.core.executor.sql.execute.SQLExecuteCallback.execute0(SQLExecuteCallback.java:72) ~[sharding-core-3.1.0.jar:na]
at io.shardingsphere.core.executor.sql.execute.SQLExecuteCallback.execute(SQLExecuteCallback.java:61) ~[sharding-core-3.1.0.jar:na]
at io.shardingsphere.core.executor.ShardingExecuteEngine.syncGroupExecute(ShardingExecuteEngine.java:175) ~[sharding-core-3.1.0.jar:na]
at io.shardingsphere.core.executor.ShardingExecuteEngine.groupExecute(ShardingExecuteEngine.java:152) ~[sharding-core-3.1.0.jar:na]
at io.shardingsphere.core.executor.sql.execute.SQLExecuteTemplate.executeGroup(SQLExecuteTemplate.java:71) ~[sharding-core-3.1.0.jar:na]
at io.shardingsphere.core.executor.sql.execute.SQLExecuteTemplate.executeGroup(SQLExecuteTemplate.java:54) ~[sharding-core-3.1.0.jar:na]
at io.shardingsphere.shardingjdbc.executor.AbstractStatementExecutor.executeCallback(AbstractStatementExecutor.java:114) ~[sharding-jdbc-core-3.1.0.jar:na]
at io.shardingsphere.shardingjdbc.executor.PreparedStatementExecutor.execute(PreparedStatementExecutor.java:148) ~[sharding-jdbc-core-3.1.0.jar:na]
at io.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:137) ~[sharding-jdbc-core-3.1.0.jar:na]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:326) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:136) ~[mybatis-3.4.6.jar:3.4.6]
at sun.reflect.GeneratedMethodAccessor313.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.4.6.jar:3.4.6]
at com.melon.contract.dao.interceptor.CxMartSelectInterceptor.intercept(CxMartSelectInterceptor.java:61) ~[contract-dao-0.0.1.jar:na]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.4.6.jar:3.4.6]
at com.sun.proxy.$Proxy112.query(Unknown Source) ~[na:na]
at sun.reflect.GeneratedMethodAccessor313.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) ~[mybatis-3.4.6.jar:3.4.6]
at com.sun.proxy.$Proxy112.query(Unknown Source) ~[na:na]
at sun.reflect.GeneratedMethodAccessor313.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.4.6.jar:3.4.6]
at com.github.pagehelper.SqlUtil._processPage(SqlUtil.java:401) ~[pagehelper-4.1.6.jar:na]
at com.github.pagehelper.SqlUtil.processPage(SqlUtil.java:374) ~[pagehelper-4.1.6.jar:na]
at com.github.pagehelper.PageHelper.intercept(PageHelper.java:255) ~[pagehelper-4.1.6.jar:na]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.4.6.jar:3.4.6]
at com.sun.proxy.$Proxy112.query(Unknown Source) ~[na:na]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) ~[mybatis-3.4.6.jar:3.4.6]
at sun.reflect.GeneratedMethodAccessor357.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) ~[mybatis-spring-1.3.2.jar:1.3.2]
... 50 common frames omitted
我有一张分表(20张)有一个字段line_num,服务器部署了5个实例,在某一个时间段内,在某一台实例上会出现Unknown column 'line_num' in 'field list',其他实例相同的语句是正确的。首先明确数据库实例只有一个,数据库也存在字段。但是程序发布或者重启的时候就比较大概率出现这个问题,出现后只要不重启或者发布程序,就不会再现。
数据库版本:5.7.16-log
spring:5.0.8.RELEASE
sharding.jdbc:3.1.0
druid:1.1.9
mysql-connector-java:5.1.48
pagehelper:4.1.6
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
顶起来,坐等答案