
HTTP Status 500 – Internal Server Error
Type 例外報告
訊息 Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:
描述 服務器遇到一個意外的情況,阻止它完成請求。
Exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:
### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?€€?€€?€€?€€UPDATE t_user
SET username='123',loginname='15212257365',email' at line 1
### The error may involve com.iflytek.uaac.dao.UserDao.update-Inline
### The error occurred while setting parameters
### SQL: UPDATE t_user SET username=?,loginname=?,email=?,phone=?,status=? WHERE id=?
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?€€?€€?€€?€€UPDATE t_user
SET username='123',loginname='15212257365',email' at line 1
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?€€?€€?€€?€€UPDATE t_user
SET username='123',loginname='15212257365',email' at line 1
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
Root Cause
org.springframework.jdbc.BadSqlGrammarException:
### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?€€?€€?€€?€€UPDATE t_user
SET username='123',loginname='15212257365',email' at line 1
### The error may involve com.iflytek.uaac.dao.UserDao.update-Inline
### The error occurred while setting parameters
### SQL: UPDATE t_user SET username=?,loginname=?,email=?,phone=?,status=? WHERE id=?
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?€€?€€?€€?€€UPDATE t_user
SET username='123',loginname='15212257365',email' at line 1
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?€€?€€?€€?€€UPDATE t_user
SET username='123',loginname='15212257365',email' at line 1
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71)
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)
com.sun.proxy.$Proxy15.update(Unknown Source)
org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:251)
org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)
org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40)
com.sun.proxy.$Proxy22.update(Unknown Source)
com.iflytek.uaac.service.impl.UserServiceImpl.update(UserServiceImpl.java:36)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
com.sun.proxy.$Proxy23.update(Unknown Source)
com.iflytek.uaac.controller.UserController.update(UserController.java:37)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:114)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
Root Cause
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?€€?€€?€€?€€UPDATE t_user
SET username='123',loginname='15212257365',email' at line 1
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
com.mysql.jdbc.Util.getInstance(Util.java:378)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1031)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3361)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3295)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1852)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1975)
com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2476)
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1404)
com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:976)
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute(NewProxyPreparedStatement.java:67)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:58)
com.sun.proxy.$Proxy30.execute(Unknown Source)
org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:41)
org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:66)
org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:45)
org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:108)
org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)
org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:145)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
uj5u.com熱心網友回復:
update t_user 的sql寫錯了uj5u.com熱心網友回復:
<update id="update" parameterType="User">
UPDATE t_user
SET username=#{username},loginname=#{loginname},email=#{email},phone=#{phone},status=#{status}
WHERE id=#{id}
</update>
這個感覺沒問題啊
uj5u.com熱心網友回復:
check the manual that corresponds to your MySQL server version for the right syntax to use near '?€€?€€?€€?€€UPDATE t_userSET username='123',loginname='15212257365',email' at line 1 這個例外說明SQL陳述句出現了問題
uj5u.com熱心網友回復:
<update id="update" parameterType="User">UPDATE t_user
SET username=#{username},loginname=#{loginname},email=#{email},phone=#{phone},status=#{status}
WHERE id=#{id}
</update>
這個感覺沒問題啊
uj5u.com熱心網友回復:
可能有些引數沒傳,資料庫又設定不能為空導致錯誤uj5u.com熱心網友回復:
把你的sql陳述句拿到工具里面運行一遍,看看有沒有錯誤;另外:status 是MySQL關鍵詞要這樣寫:'status'
<update id="update" parameterType="User">
UPDATE t_user
SET username=#{username},loginname=#{loginname},email=#{email},phone=#{phone},'status'=#{status}
WHERE id=#{id}
</update>
uj5u.com熱心網友回復:
在mysql里面運行沒有問題的。但是在mybatis就不行uj5u.com熱心網友回復:
在mysql里面是正常運行的?
uj5u.com熱心網友回復:
在mysql里面是正常運行的?
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/83533.html
標籤:Java EE
上一篇:網站后臺更改管理員密碼后,管理后臺的模塊全部不見咖是怎了,請問各位大么回事?怎么樣才能找回,跪求各位賜教,我是技術小白,指點盡量詳細一些,另程式是Java語言
下一篇:JAVA實作分析井字游戲勝負
