Restlet 上测试Login.do, 显示500

来源:6-9 用户模块所有功能自测试

weixin_慕仙4318319

2021-08-22

老师, 这个 Error 我自己看了很久, 还是没找到什么原因, 您能不能帮我看一下,感激不尽 😭

http://img.mukewang.com/szimg/612152ba099fe02828441524.jpg


<!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" ><p><b>Type</b> Exception Report</p><p><b>Message</b> Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: </p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><p><b>Exception</b></p><pre>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: 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 &#39;username = &#39;admin&#39;&#39; at line 2
### The error may exist in file [&#47;Users&#47;shuhuasong&#47;Applications&#47;apache-tomcat-9.0.48&#47;webapps&#47;ROOT&#47;WEB-INF&#47;classes&#47;mappers&#47;UserMapper.xml]
### The error may involve com.mmall.dao.UserMapper.checkUsername-Inline
### The error occurred while setting parameters
### SQL: select count(1) from mmall_user     whhere username = ?
### 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 &#39;username = &#39;admin&#39;&#39; at line 2
; 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 &#39;username = &#39;admin&#39;&#39; at line 2
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:943)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)</pre><p><b>Root Cause</b></p><pre>org.springframework.jdbc.BadSqlGrammarException: 
### Error querying 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 &#39;username = &#39;admin&#39;&#39; at line 2
### The error may exist in file [&#47;Users&#47;shuhuasong&#47;Applications&#47;apache-tomcat-9.0.48&#47;webapps&#47;ROOT&#47;WEB-INF&#47;classes&#47;mappers&#47;UserMapper.xml]
### The error may involve com.mmall.dao.UserMapper.checkUsername-Inline
### The error occurred while setting parameters
### SQL: select count(1) from mmall_user     whhere username = ?
### 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 &#39;username = &#39;admin&#39;&#39; at line 2
; 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 &#39;username = &#39;admin&#39;&#39; at line 2
	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:75)
	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:447)
	com.sun.proxy.$Proxy21.selectOne(Unknown Source)
	org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:167)
	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
	com.sun.proxy.$Proxy22.checkUsername(Unknown Source)
	com.mmall.service.Impl.UserServiceImpl.login(UserServiceImpl.java:30)
	com.mmall.controller.portal.UserController.login(UserController.java:39)
	java.base&#47;jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	java.base&#47;jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	java.base&#47;jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.base&#47;java.lang.reflect.Method.invoke(Method.java:567)
	org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:214)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:748)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)</pre><p><b>Root Cause</b></p><pre>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 &#39;username = &#39;admin&#39;&#39; at line 2
	java.base&#47;jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	java.base&#47;jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	java.base&#47;jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	java.base&#47;java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	java.base&#47;java.lang.reflect.Constructor.newInstance(Constructor.java:481)
	com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
	com.mysql.jdbc.Util.getInstance(Util.java:381)
	com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)
	com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
	com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
	com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
	com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
	com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
	com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
	com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
	com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:995)
	org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
	org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
	java.base&#47;jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	java.base&#47;jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	java.base&#47;jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.base&#47;java.lang.reflect.Method.invoke(Method.java:567)
	org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
	com.sun.proxy.$Proxy26.execute(Unknown Source)
	org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63)
	org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
	org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)
	org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
	org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
	org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
	org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
	java.base&#47;jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	java.base&#47;jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	java.base&#47;jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.base&#47;java.lang.reflect.Method.invoke(Method.java:567)
	org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
	com.github.pagehelper.SqlUtil._processPage(SqlUtil.java:401)
	com.github.pagehelper.SqlUtil.processPage(SqlUtil.java:374)
	com.github.pagehelper.PageHelper.intercept(PageHelper.java:250)
	org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
	com.sun.proxy.$Proxy24.query(Unknown Source)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77)
	java.base&#47;jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	java.base&#47;jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	java.base&#47;jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.base&#47;java.lang.reflect.Method.invoke(Method.java:567)
	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:434)
	com.sun.proxy.$Proxy21.selectOne(Unknown Source)
	org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:167)
	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
	com.sun.proxy.$Proxy22.checkUsername(Unknown Source)
	com.mmall.service.Impl.UserServiceImpl.login(UserServiceImpl.java:30)
	com.mmall.controller.portal.UserController.login(UserController.java:39)
	java.base&#47;jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	java.base&#47;jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	java.base&#47;jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.base&#47;java.lang.reflect.Method.invoke(Method.java:567)
	org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:214)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:748)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:833)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)</pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class="line" ><h3>Apache Tomcat/9.0.48</h3></body></html>
写回答

1回答

weixin_慕仙4318319

提问者

2021-08-25

上面的问题已经解决了, 但是出现了新的问题, 这个问题也是在 reslet 上显示 500, 这个问题会影响后续的开发吗?

//img.mukewang.com/szimg/6125d5e409e9ffe725560244.jpg

//img.mukewang.com/szimg/6125d65509134af021940916.jpg



0
0

从0开始 独立完成企业级Java电商网站服务端开发

前后端分离,数据库接口设计,架构设计,功能开发,上线运维

9476 学习 · 8804 问题

查看课程