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”,表中缺少欄位!
相關文章
- n [Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Failed to invoAIExceptionRPC
- Initialization of bean failed; nested exception is java.lang.StackOverflowErrorBeanAIExceptionJavaError
- HTTP Status 400 – Bad RequestHTTP
- 經常出現 HTTP Status 500 -錯誤HTTP
- solrcloud 報 HTTP Status 503 - Server is shutting down or failed to initializeSolrCloudHTTPServerAI
- git error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500GitErrorRPCAIHTTP
- nested exception is IncompleteElementException: Could not find parameter mapException
- dubbo和spring結合報錯 Invocation of init method failed; nested exception is java.lang.IllegalArgumentExceSpringAIExceptionJava
- Asp.Net Sync & ASync Processing requestASP.NET
- nested exception is java.lang.NoSuchMethodException: 實體類.()ExceptionJava
- request gap sequence is FailedAI
- 【es】FATAL [circuit_breaking_exception] [parent] Data too large, data for [<http_request>] would beUIExceptionHTTP
- HTTP狀態碼->HTTP Status CodeHTTP
- HTTP狀態碼(HTTP Status Code)HTTP
- Check failed: status == CUDNN_STATUS_SUCCESS (4 vs. 0) CUDNN_STATUS_INTERNAL_ERRORAIDNNError
- nested exception is java.lang.NoSuchFieldError: FAIL_ON_SYMBOL_HASH_OVERFLOWExceptionJavaErrorAISymbol
- Servlet&HTTP&RequestServletHTTP
- ElasticSearch:Request cannot be executed; I/O reactor status: STOPPEDElasticsearchReact
- PHP Simulation HTTP Request(undone)PHPHTTP
- Jmeter之HTTP Request DefaultsJMeterHTTP
- { “code”: “-1”, “msg”: “nested exception is org.apache.ibatis.exceptions.TooManyResultsException: ExExceptionApacheBATOOM
- HTTP協議狀態碼詳解(HTTP Status Code)HTTP協議
- java.lang.Exception: Socket bind failed: [730048]JavaExceptionAI
- 報錯:nested exception is java.lang.NoClassDefFoundError: org/fusesource/hawtbuf/UTF8BufferExceptionJavaError
- nested exception is javax.validation.ValidationException錯誤解決思路ExceptionJava
- nested exception is org.hibernate.InvalidMappingException: Could not parse mappiExceptionAPP
- 你需要了解的 HTTP Status CodeHTTP
- nginx: 400 Bad Request | The plain HTTP request was sent to HTTPS portNginxAIHTTP
- Error parsing HTTP request header--400 bad requestErrorHTTPHeader
- Jmeter系列(21)- 詳解 HTTP RequestJMeterHTTP
- HTTP Headers的Request HeadersHTTPHeader
- nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379ExceptionRedislocalhost
- spring No default constructor found; nested exception is java.lang.NoSuchMethodException: com.slj.moSpringStructExceptionJava
- ios Request failed: unacceptable content-type: text/html"iOSAIHTML
- HTTP Status 404 的詳細解決思路HTTP
- ORA-27300: OS system dependent operation:fork failed with statusAI
- Unknown column ‘name‘ in ‘field list‘ ; bad SQL grammar []; nested exception is com.mysql.jdbc.excepExceptionMySqlJDBC
- 解決elasticsearch:Exception BindTransportException[Failed to bind to [9300-9400]]ElasticsearchExceptionAI