HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.BadSqlGram

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介: HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:type Exception reportmessage Request processing failed; nested exception is org.
HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:


type Exception report


message Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:


description The server encountered an internal error that prevented it from fulfilling this request.


exception


org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: 
### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'STATUS' in 'field list'
### The error may exist in URL [jar:file:/F:/workForder/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/xinghe-web/WEB-INF/lib/xinghe-base-0.0.1-SNAPSHOT.jar!/com/xinghe/base/model/mapper/TeacherMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT                   ID ,          TEACHER_NAME,          TEACHER_TITLE_ID ,          SCHOOL_ID ,          DEPARTMENT ,          JOB ,          USER_ID ,          CREATE_TIME ,          UPDATE_TIME ,          SEX ,          BIRTHDAY ,          BIRTH_ADDRESS ,          NATIVE_PLACE ,          NATION ,          NATIONALITY_ID ,          AREA_ID ,          HUKOUSER_LOCUS ,          HUKOUSER_TYPE ,          IDCARD_TYPE ,          ID_NO ,          ID_EXPIRY_DATE ,          USER_TYPE_CODE ,          POLITICAL_STATUS ,          HEALTH_CONDITION ,          TAGS ,          DESCRIPTION ,          PLAT_MARK ,          STATUS           ,       (select TRUE_NAME  from auth_user u where u.ID = t.USER_ID) TRUE_NAME,       (select PHOTO from auth_user u where u.ID = t.USER_ID) PHOTO      FROM xg_teacher t      WHERE ID IN        (SELECT OBJECT_ID FROM (SELECT OBJECT_ID FROM xg_recommend WHERE REC_TYPE = 0 ORDER BY CREATE_TIME LIMIT 5) AS r) ;
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'STATUS' in 'field list'
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'STATUS' in 'field list'
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:965)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
com.auth.filter.AuthorizationFilter.doFilterInternal(AuthorizationFilter.java:77)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
com.auth.filter.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:111)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
root cause


org.springframework.jdbc.BadSqlGrammarException: 
### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'STATUS' in 'field list'
### The error may exist in URL [jar:file:/F:/workForder/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/xinghe-web/WEB-INF/lib/xinghe-base-0.0.1-SNAPSHOT.jar!/com/xinghe/base/model/mapper/TeacherMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT                   ID ,          TEACHER_NAME,          TEACHER_TITLE_ID ,          SCHOOL_ID ,          DEPARTMENT ,          JOB ,          USER_ID ,          CREATE_TIME ,          UPDATE_TIME ,          SEX ,          BIRTHDAY ,          BIRTH_ADDRESS ,          NATIVE_PLACE ,          NATION ,          NATIONALITY_ID ,          AREA_ID ,          HUKOUSER_LOCUS ,          HUKOUSER_TYPE ,          IDCARD_TYPE ,          ID_NO ,          ID_EXPIRY_DATE ,          USER_TYPE_CODE ,          POLITICAL_STATUS ,          HEALTH_CONDITION ,          TAGS ,          DESCRIPTION ,          PLAT_MARK ,          STATUS           ,       (select TRUE_NAME  from auth_user u where u.ID = t.USER_ID) TRUE_NAME,       (select PHOTO from auth_user u where u.ID = t.USER_ID) PHOTO      FROM xg_teacher t      WHERE ID IN        (SELECT OBJECT_ID FROM (SELECT OBJECT_ID FROM xg_recommend WHERE REC_TYPE = 0 ORDER BY CREATE_TIME LIMIT 5) AS r) ;
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'STATUS' in 'field list'
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'STATUS' in 'field list'
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:237)
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371)
com.sun.proxy.$Proxy12.selectList(Unknown Source)
org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:191)
com.xinghe.base.dao.TeacherDao.teacherRecommendSelect(TeacherDao.java:49)
com.xinghe.base.service.TeacherManager.teacherRecommendSelect(TeacherManager.java:44)
com.xinghe.base.service.TeacherManager$$FastClassBySpringCGLIB$$6d3f88cd.invoke(<generated>)
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:700)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:633)
com.xinghe.base.service.TeacherManager$$EnhancerBySpringCGLIB$$9d3443c0.teacherRecommendSelect(<generated>)
com.xinghe.base.action.TeacherPublic.teacherRecommendSelect(TeacherPublic.java:37)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
com.auth.filter.AuthorizationFilter.doFilterInternal(AuthorizationFilter.java:77)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
com.auth.filter.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:111)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
root cause


com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'STATUS' in 'field list'
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
com.mysql.jdbc.Util.getInstance(Util.java:386)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2734)
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1379)
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute(NewProxyPreparedStatement.java:989)
sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:62)
com.sun.proxy.$Proxy18.execute(Unknown Source)
org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:59)
org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:73)
org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:60)
org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267)
org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:137)
org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:120)
sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
com.xinghe.mybatis.FlushCacheInterceptor.intercept(FlushCacheInterceptor.java:61)
org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:60)
com.sun.proxy.$Proxy16.query(Unknown Source)
sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
com.xinghe.mybatis.OffsetLimitInterceptor.intercept(OffsetLimitInterceptor.java:55)
org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:60)
com.sun.proxy.$Proxy16.query(Unknown Source)
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108)
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)
com.sun.proxy.$Proxy12.selectList(Unknown Source)
org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:191)
com.xinghe.base.dao.TeacherDao.teacherRecommendSelect(TeacherDao.java:49)
com.xinghe.base.service.TeacherManager.teacherRecommendSelect(TeacherManager.java:44)
com.xinghe.base.service.TeacherManager$$FastClassBySpringCGLIB$$6d3f88cd.invoke(<generated>)
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:700)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:633)
com.xinghe.base.service.TeacherManager$$EnhancerBySpringCGLIB$$9d3443c0.teacherRecommendSelect(<generated>)
com.xinghe.base.action.TeacherPublic.teacherRecommendSelect(TeacherPublic.java:37)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
com.auth.filter.AuthorizationFilter.doFilterInternal(AuthorizationFilter.java:77)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
com.auth.filter.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:111)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.54 logs.

Apache Tomcat/7.0.54


看错误提示,涉及到了SQL语句,这明显就是SQL语句与数据库表结构不统一导致的问题!

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'STATUS' in 'field list'

原因:未知的字段“STATUS”,表中缺少字段!

相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
2月前
|
安全 应用服务中间件 网络安全
修复HTTPS升级后出现 Mixed Content: The page at 'https://xxx' was loaded over HTTPS, but requested an insecure frame 'http://xxx'. This request has been blocked; the content must be served over HTTPS. 的问题
修复HTTPS升级后出现 Mixed Content: The page at 'https://xxx' was loaded over HTTPS, but requested an insecure frame 'http://xxx'. This request has been blocked; the content must be served over HTTPS. 的问题
|
4月前
|
Python
【Azure 应用服务】Azure Function HTTP Trigger 遇见奇妙的500 Internal Server Error: Failed to forward request to http://169.254.130.x
【Azure 应用服务】Azure Function HTTP Trigger 遇见奇妙的500 Internal Server Error: Failed to forward request to http://169.254.130.x
|
6月前
|
小程序
Failed to load local image resource Xx the server responded with a status of of 500 (HTTP/1.1 500)
Failed to load local image resource Xx the server responded with a status of of 500 (HTTP/1.1 500)
163 4
|
6月前
svn: E175002: Commit failed (details follow): svn: E175002: Unexpected HTTP status 502Bad Gateway on
svn: E175002: Commit failed (details follow): svn: E175002: Unexpected HTTP status 502Bad Gateway on
184 1
Bad Request, Resolved [org.springframework.http.converter.HttpMessageNotReadableException,跟着视频仔细比对
Bad Request, Resolved [org.springframework.http.converter.HttpMessageNotReadableException,跟着视频仔细比对
|
5月前
|
API Java
解决HTTP 400 Bad Request错误的方法
解决HTTP 400 Bad Request错误的方法
1314 0
|
5月前
|
Java API
解决HTTP 400 Bad Request错误的方法
解决HTTP 400 Bad Request错误的方法
|
2月前
|
Java 关系型数据库 MySQL
mysql5.7 jdbc驱动
遵循上述步骤,即可在Java项目中高效地集成MySQL 5.7 JDBC驱动,实现数据库的访问与管理。
498 1
|
2月前
|
SQL 分布式计算 关系型数据库
Hadoop-24 Sqoop迁移 MySQL到Hive 与 Hive到MySQL SQL生成数据 HDFS集群 Sqoop import jdbc ETL MapReduce
Hadoop-24 Sqoop迁移 MySQL到Hive 与 Hive到MySQL SQL生成数据 HDFS集群 Sqoop import jdbc ETL MapReduce
110 0
|
2月前
|
SQL 分布式计算 关系型数据库
Hadoop-23 Sqoop 数据MySQL到HDFS(部分) SQL生成数据 HDFS集群 Sqoop import jdbc ETL MapReduce
Hadoop-23 Sqoop 数据MySQL到HDFS(部分) SQL生成数据 HDFS集群 Sqoop import jdbc ETL MapReduce
51 0