bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column ‘la.updateT

    科技2022-07-11  128

    问题:这种情况就是数据库字段对应不上。

    解决:mapper对应一下数据库字段就可以,好好看看。

     

    ### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'la.updateTime' in 'order clause' ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column 'la.updateTime' in 'order clause'     at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:234)     at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)     at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)     at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)     at com.sun.proxy.$Proxy74.selectList(Unknown Source)     at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)     at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:139)     at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:76)     at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)     at com.sun.proxy.$Proxy101.getByEntity(Unknown Source)     at org.linlinjava.litemall.db.service.LitemallInfoService.getByEntity(LitemallInfoService.java:36)     at org.linlinjava.litemall.wx.web.DevLitemallInfoController.list(DevLitemallInfoController.java:31)     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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)     at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)     at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)     at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)     at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039)     at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)     at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)     at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)     at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)     at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)     at com.github.xiaoymin.swaggerbootstrapui.filter.SecurityBasicAuthFilter.doFilter(SecurityBasicAuthFilter.java:84)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)     at com.github.xiaoymin.swaggerbootstrapui.filter.ProductionSecurityFilter.doFilter(ProductionSecurityFilter.java:53)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)     at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96)     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)     at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)     at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)     at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)     at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)     at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200)     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)     at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)     at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)     at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:836)     at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1747)     at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)     at java.lang.Thread.run(Thread.java:748) Caused by: java.sql.SQLSyntaxErrorException: Unknown column 'la.updateTime' in 'order clause'     at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)     at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)     at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)     at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:955)     at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:372)     at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3409)     at com.alibaba.druid.wall.WallFilter.preparedStatement_execute(WallFilter.java:619)     at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3407)     at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440)     at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3407)     at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:167)     at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498)     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.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)     at com.sun.proxy.$Proxy126.execute(Unknown Source)     at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63)     at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)     at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)     at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:326)     at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)     at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)     at com.github.pagehelper.PageInterceptor.intercept(PageInterceptor.java:136)     at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)     at com.sun.proxy.$Proxy168.query(Unknown Source)     at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)     at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)     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.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)     ... 75 common frames omitted 17:33:52 [http-nio-8082-exec-10] DEBUG o.s.w.s.m.m.a.RequestResponseBodyMethodProcessor - Using 'application/json', given [*/*] and supported [application/json, application/*+json, application/json, application/*+json] 17:33:52 [http-nio-8082-exec-10] DEBUG o.s.w.s.m.m.a.RequestResponseBodyMethodProcessor - Writing [{errno=502, errmsg=系统内部错误}] 17:33:52 [http-nio-8082-exec-10] WARN  o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Resolved [org.springframework.jdbc.BadSqlGrammarException:  ### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: Unknown column 'la.updateTime' in 'order clause' ### The error may exist in org/linlinjava/litemall/db/dao/LitemallInfoMapper.xml ### The error may involve org.linlinjava.litemall.db.dao.LitemallInfoMapper.getByEntity-Inline ### The error occurred while setting parameters ### SQL: select         la.id AS la_id,     la.name AS la_name,     la.url AS la_url,     la.position AS la_position,     la.content AS la_content,     la.enabled AS la_enabled,     la.add_time AS la_add_time,     la.update_time AS la_update_time,     la.deleted AS la_deleted,     la.type AS la_type,     la.click_num AS la_click_num         from litemall_info la      WHERE la.type = ?       order by la.updateTime LIMIT ? ### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'la.updateTime' in 'order clause' ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column 'la.updateTime' in 'order clause'] 17:33:52 [http-nio-8082-exec-10] DEBUG o.s.web.servlet.DispatcherServlet - Completed 200 OK 17:33:52 [http-nio-8082-exec-9] DEBUG o.s.web.servlet.DispatcherServlet - GET "/webjars/bycdao-ui/ace-editor/worker-json.js", parameters={} 17:33:52 [http-nio-8082-exec-9] DEBUG s.d.s.w.PropertySourcedRequestMappingHandlerMapping - looking up handler for path: /webjars/bycdao-ui/ace-editor/worker-json.js 17:33:52 [http-nio-8082-exec-9] DEBUG o.s.w.s.h.SimpleUrlHandlerMapping - Mapped to ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"] 17:33:52 [http-nio-8082-exec-9] DEBUG o.s.web.servlet.DispatcherServlet - Completed 200 OK  

    Processed: 0.018, SQL: 8