HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.BadSqlGram
HTTP Status 有很多,其中最常見的應該是 500 錯誤了。
這篇文章我就給大家分享一下, HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.BadSqlGram 的解決辦法!
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
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
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
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
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”,表中缺少欄位!
相關文章
- HTTP Status 400 – Bad RequestHTTP
- git error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500GitErrorRPCAIHTTP
- dubbo和spring結合報錯 Invocation of init method failed; nested exception is java.lang.IllegalArgumentExceSpringAIExceptionJava
- nested exception is java.lang.NoSuchMethodException: 實體類.()ExceptionJava
- 【es】FATAL [circuit_breaking_exception] [parent] Data too large, data for [<http_request>] would beUIExceptionHTTP
- Check failed: status == CUDNN_STATUS_SUCCESS (4 vs. 0) CUDNN_STATUS_INTERNAL_ERRORAIDNNError
- nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379ExceptionRedislocalhost
- { “code”: “-1”, “msg”: “nested exception is org.apache.ibatis.exceptions.TooManyResultsException: ExExceptionApacheBATOOM
- ElasticSearch:Request cannot be executed; I/O reactor status: STOPPEDElasticsearchReact
- Servlet&HTTP&RequestServletHTTP
- Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the processErrorExceptionAI
- ORA-27300: OS system dependent operation:fork failed with statusAI
- HTTP Headers的Request HeadersHTTPHeader
- 解決elasticsearch:Exception BindTransportException[Failed to bind to [9300-9400]]ElasticsearchExceptionAI
- HTTP協議狀態碼詳解(HTTP Status Code)HTTP協議
- Unknown column ‘name‘ in ‘field list‘ ; bad SQL grammar []; nested exception is com.mysql.jdbc.excepExceptionMySqlJDBC
- 報錯:nested exception is java.lang.NoClassDefFoundError: org/fusesource/hawtbuf/UTF8BufferExceptionJavaError
- ORA-27300: OS system dependent operation:fork failed with status: 12AI
- PostgreSQL Detail: Failed on request of size 8192 in memory context "ErrorContexSQLAIContextError
- 你需要了解的 HTTP Status CodeHTTP
- 執行systemctl status ssh返回“Failed to get properties: Connection timed out”AI
- RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED解決辦法ErrorDNNAI
- gitlab-runner之build failed with exit status 1問題分析GitlabUIAI
- HTTP Status 404 的詳細解決思路HTTP
- 解決bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: 無效字元SQLExceptionJavaError字元
- Jmeter系列(21)- 詳解 HTTP RequestJMeterHTTP
- ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00909: 引數個數無效SQLExceptionJavaError
- Java訪問Elasticsearch報錯Request cannot be executed; I/O reactor status: STOPPEDJavaElasticsearchReact
- Springboot jar 部署IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/byte-budSpring BootJARExceptionAIHive
- nodejs使用request傳送http請求NodeJSHTTP
- 記錄Windows failed fast startup with error status 0xC00000D4.WindowsAIASTError
- 基礎篇-http協議《http 簡介、url詳解、request》HTTP協議
- SAP CRM中介軟體Request download的警告資訊:message Object is in status WaitObjectAI
- status 返回當前請求的http狀態碼HTTP
- Spring Mvc Http 400 Bad Request問題排查SpringMVCHTTP
- command 'gcc' failed with exit status 1錯誤問題的解決辦法GCAI
- npm ERR! network request to https://registry.npmmirror.com/create-vite failed,NPMHTTPViteAI
- http request-01-XMLHttpRequest XHR 簡單介紹HTTPXML