zoukankan      html  css  js  c++  java
  • ssm分页查询错误

    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: 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 'null' at line 4
    ### The error may exist in mapper/CustomerDao.xml
    ### The error may involve mapper.CustomerDao.selectCustomerListByQuery-Inline
    ### The error occurred while setting parameters
    ### SQL: select * from customer                    limit ?,?
    ### 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 'null' at line 4
    ; 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 'null' at line 4
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    

    root cause

    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 'null' at line 4
    ### The error may exist in mapper/CustomerDao.xml
    ### The error may involve mapper.CustomerDao.selectCustomerListByQuery-Inline
    ### The error occurred while setting parameters
    ### SQL: select * from customer                    limit ?,?
    ### 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 'null' at line 4
    ; 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 'null' at line 4
    	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:73)
    	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371)
    	com.sun.proxy.$Proxy10.selectList(Unknown Source)
    	org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:198)
    	org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:119)
    	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)
    	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)
    	com.sun.proxy.$Proxy12.selectCustomerListByQuery(Unknown Source)
    	service.CustmoerServiceImpl.selectPageByQuery(CustmoerServiceImpl.java:50)
    	controller.CustomerController.list(CustomerController.java:42)
    	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.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
    	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
    	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:777)
    	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:706)
    	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    	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 'null' at line 4
    	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: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:3536)
    	com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3468)
    	com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1957)
    	com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2107)
    	com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2648)
    	com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2086)
    	com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1365)
    	com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:493)
    	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.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:62)
    	com.sun.proxy.$Proxy21.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.CachingExecutor.query(CachingExecutor.java:96)
    	org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:77)
    	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108)
    	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)
    	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.$Proxy10.selectList(Unknown Source)
    	org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:198)
    	org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:119)
    	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)
    	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)
    	com.sun.proxy.$Proxy12.selectCustomerListByQuery(Unknown Source)
    	service.CustmoerServiceImpl.selectPageByQuery(CustmoerServiceImpl.java:50)
    	controller.CustomerController.list(CustomerController.java:42)
    	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.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
    	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
    	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:777)
    	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:706)
    	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    

    note The full stack trace of the root cause is available in the Apache Tomcat/7.0.30 logs.


    Apache Tomcat/7.0.30

  • 相关阅读:
    mybatis中的配置文件的约束
    win10下PHP开发环境搭建
    装饰器的理解
    在iis上添加woff字体文件读取
    转发:使用sql命令查询视图中所有引用的基础表
    转:C4项目中验证用户登录一个特性就搞定
    转载:NSobject官方介绍
    thinkphp生命周期
    array_intersect_assoc — 带索引检查计算数组的交集
    array_flip — 交换数组中的键和值
  • 原文地址:https://www.cnblogs.com/cstxx77/p/12366341.html
Copyright © 2011-2022 走看看