记一次MyBatis分页莫名其妙的失效,首次执行合适,后续执行分页失效且异常

代码几乎一样,为啥这个xml配置的就会出现莫名其妙的问题呢

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='mybatis_plus_first', mode=IN, javaType=long, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #3 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2).

at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:97)

at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439)

at com.sun.proxy.$Proxy131.selectList(Unknown Source)

at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224)

at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForIPage(MybatisMapperMethod.java:121)

at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:85)

at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152)

at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)

at com.sun.proxy.$Proxy237.getSearchIndexByPage(Unknown Source)

at com.bigdatacd.panorama.system.service.impl.SearchIndexServiceImpl.getSearchIndexByPage(SearchIndexServiceImpl.java:31)

at com.bigdatacd.panorama.system.service.impl.SearchIndexServiceImplFastClassBySpringCGLIBbb45ed4a.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:792)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762)

at com.baomidou.dynamic.datasource.aop.DynamicDataSourceAnnotationInterceptor.invoke(DynamicDataSourceAnnotationInterceptor.java:57)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:762)

at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:707)

at com.bigdatacd.panorama.system.service.impl.SearchIndexServiceImplEnhancerBySpringCGLIB3684ef87.getSearchIndexByPage(<generated>)

at com.bigdatacd.panorama.system.controller.SearchIndexController.getSearchIndexByPage(SearchIndexController.java:40)

at com.bigdatacd.panorama.system.controller.SearchIndexControllerFastClassBySpringCGLIBcc3a314a.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

最后,发现xml的注释 如-- 这样的会引起解析分页失败好吧,不追究了奇奇怪怪的问题

相关推荐
落木萧萧8255 小时前
为什么我把 MyBatisGX 设计成现在这样
mybatis·orm
代码旅人ing5 小时前
Redis+Spring+MyBatis + 微服务 + 消息队列核心知识点(面试高频题目合集)
redis·spring·mybatis·java-rabbitmq
Devin~Y5 小时前
大厂Java面试实录:Spring Boot/Cloud、Kafka、Redis、K8s 可观测性 + RAG/Agent(小Y翻车版)
java·spring boot·redis·spring cloud·kafka·kubernetes·mybatis
ppandss17 小时前
JavaWeb从0到1-DAY11-MyBatis入门
java·tomcat·mybatis
JAVA面经实录91719 小时前
MyBatis面试题库
java·mybatis
杨运交20 小时前
[022][数据模块]基于雪花算法的 MyBatis-Plus 主键生成器设计与实现
mybatis
Mahir081 天前
MyBatis 深度解密:从执行流程到底层原理全解
java·后端·面试·mybatis
Mahir081 天前
MyBatis 分页与插件深度解密:从插件机制到三大分页方案原理全解
java·后端·mybatis·mybatis-plus·大厂面试题
谷哥的小弟1 天前
图文详解Spring Boot整合MyBatisPlus(附源码)
mybatis·源码·springboot·mybatis-plus·整合
醉颜凉1 天前
Lucene底层原理:倒排索引实现原理与代码实战,彻底吃透搜索引擎核心
搜索引擎·mybatis·lucene