记一次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的注释 如-- 这样的会引起解析分页失败好吧,不追究了奇奇怪怪的问题

相关推荐
clk66076 小时前
SSM 框架核心知识详解(Spring + SpringMVC + MyBatis)
java·spring·mybatis
愿你天黑有灯下雨有伞12 小时前
MyBatis-Plus LambdaQuery 高级用法:JSON 路径查询与条件拼接的全场景解析
mysql·json·mybatis
万能的编程语言17 小时前
mybatis 参数绑定错误示范(1)
java·mybatis
贺函不是涵17 小时前
【沉浸式求职学习day52】【初识Mybaits】
java·学习·mybatis
the_seventh_dog1 天前
mybatis和hibernate区别
java·mybatis·hibernate
HGW6891 天前
基于MyBatis插件实现动态表名解决多环境单一数据库问题
数据库·mybatis
wangfenglei1234561 天前
mybatis打印完整的SQL,p6spy
数据库·sql·mybatis
果壳~1 天前
【Java】mybatis-plus乐观锁与Spring重试机制
java·spring·mybatis
星star~2 天前
MyBatis相关面试题
java·开发语言·mybatis
会飞的架狗师2 天前
为何选择Spring框架学习设计模式与编码技巧?
学习·spring·mybatis