zoukankan      html  css  js  c++  java
  • It's likely that neither a Result Type nor a Result Map was specified

    1、错误描述

     2017-08-29 14:30:49,951 [http-bio-8888-exec-2] ERROR [core.security.process.exception.ExceptionResolverCustom] - nested exception is org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'StudentMapper.count'.  It's likely that neither a Result Type nor a Result Map was specified.
      org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'StudentMapper.count'.  It's likely that neither a Result Type nor a Result Map was specified.
    	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
    	at core.util.CustomSqlSessionTemplate$SqlSessionInterceptor.invoke(CustomSqlSessionTemplate.java:316)
    	at com.sun.proxy.$Proxy85.selectOne(Unknown Source)
    	at core.util.CustomSqlSessionTemplate.selectOne(CustomSqlSessionTemplate.java:121)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
    	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
    	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
    	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    	at java.lang.Thread.run(Thread.java:748)
    Caused by: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'StudentMapper.count'.  It's likely that neither a Result Type nor a Result Map was specified.
    	at org.apache.ibatis.executor.resultset.FastResultSetHandler.validateResultMapsCount(FastResultSetHandler.java:182)
    	at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSets(FastResultSetHandler.java:155)
    	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:57)
    	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:70)

    2、错误原因

    <select id="count" parameterType="student">
             select count(*) from t_student_info    
    </select>
          Mybatis配置文件中没有返回类型参数

    3、解决办法

         添加resultType参数值

     <select id="count" parameterType="student" resultType="count">
             select count(*) from t_student_info    
     </select>


  • 相关阅读:
    systemd 启动 logstash 报错 找不到 JAVA_HOME
    Spring boot内置Tomcat的临时目录被删除导致文件上传不了-问题解析
    git error: Your local changes to the following files would be overwritten by merge:xxxxxx ,Please commit your changes or stash them before you merge.的phpstorm解决办法
    thinkcmf 忘记后台登陆密码的解决办法
    thinkcmf 5关闭后台验证码
    centos 7 IP不能访问nginx Failed connect to 185.239.226.111:80; No route to host解决办法
    thinphp5框架遇到 mkdir() Permission denied 解决办法
    mysql 命令行 备份 恢复数据
    centos 7 查询mysql 安装 运行位置
    pycharm 2018.1 激活
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13313826.html
Copyright © 2011-2022 走看看