记一次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.SearchIndexServiceImpl$$FastClassBySpringCGLIB$$bb45ed4a.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.SearchIndexServiceImpl$$EnhancerBySpringCGLIB$$3684ef87.getSearchIndexByPage(<generated>)

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

at com.bigdatacd.panorama.system.controller.SearchIndexController$$FastClassBySpringCGLIB$$cc3a314a.invoke(<generated>)

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

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

相关推荐
小杨4046 小时前
springboot框架项目实践应用二十(扩展mybatis插件及原理解析)
spring boot·后端·mybatis
luoluoal19 小时前
Java项目之基于ssm的QQ村旅游网站的设计(源码+文档)
java·mysql·mybatis·ssm·源码
小杜-coding21 小时前
黑马头条day02
java·spring boot·spring·spring cloud·java-ee·maven·mybatis
ApeAssistant1 天前
记录一次 Mybatis Plus selectList的NullPointerException问题
后端·mybatis
云之兕1 天前
MyBatis 详解
java·开发语言·mybatis
Java_SuSheng1 天前
关于SQLite轻量数据库的研究
java·数据库·spring boot·sqlite·mybatis
计算机学姐2 天前
基于SpringBoo的地方美食分享网站
java·vue.js·mysql·tomcat·mybatis·springboot·美食
eternal__day2 天前
第二期:[特殊字符] 深入理解MyBatis[特殊字符]MyBatis基础CRUD操作详解[特殊字符]
java·spring·java-ee·maven·mybatis
麓殇⊙2 天前
mybatis--多对一处理/一对多处理
java·tomcat·mybatis
Java个体户2 天前
mybatis 嵌套List
mybatis