{
    "timestamp": "2022-01-17T06:47:15.437+0000",
    "status": 500,
    "error": "Internal Server Error",
    "message": "nested exception is org.apache.ibatis.exceptions.TooManyResultsException: 
Expected one result (or null) to be returned by selectOne(), but found: 3", "path": "/jiany/list" }

这个是在Postman中测试时 的报错

 

Servlet.service() for servlet [dispatcherServlet] in context with path [] 
threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException:
nested exception is org.apache.ibatis.exceptions.TooManyResultsException:
Expected one result (or null) to be returned by selectOne(), but found: 3] with root cause

这个是我Java代码中的报错

 

Page<Jiany> jianyPage = new Page<>(page,size);

IPage<Jiany> jianylist = jianyMapper.jianylist(vo,jianyPage);

这个是解决前我的参数位置

 

 IPage<Jiany> jianylist = jianyMapper.jianylist(jianyPage,vo);
//这个是解决后我的参数位置 
//这样报错就解决了  
//分页的page参数必须放在第一位 这样报错就解决了 

相关文章:

  • 2022-01-21
  • 2022-03-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
  • 2021-04-05
猜你喜欢
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2021-09-24
  • 2021-12-09
  • 2021-10-03
相关资源
相似解决方案