开发者社区 问答 正文

Mybatis 的分页插件找不到的问题,实在是无语?报错

这个是分页的配置,版本是3.7.5的 我的mybatis的版本是3.2.5的
<plugins>
                <!-- com.github.pagehelper为PageHelper类所在包名 -->
                <plugin interceptor="com.github.pagehelper.PageHelper">
                        <property name="dialect" value="mysql"/>
                    
                        <property name="offsetAsPageNum" value="true"/>
           
                        <property name="rowBoundsWithCount" value="true"/>

                        <property name="pageSizeZero" value="true"/>
  
                        <property name="reasonable" value="true"/>
                </plugin>
        </plugins>
然后在sprin的配置文件中引入这个mybatis的配置。。。
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="mapperLocations" value="classpath:mappers/*Mapper.xml" />
        <property name="configLocation" value="classpath:mybatis-config.xml"/>
    </bean>

然后就报错了。。

HTTP Status 500 - Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/plugin/Interceptor

虽然后来我自己写了个分页的插件,但是我还是很想知道这个为什么会报错,我倒现在也还在纠结这个问题中

展开
收起
爱吃鱼的程序员 2020-06-09 15:46:35 846 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    你打包后看一下lib中有没有包这个必须肯定是有的<spanstyle="font-size:18px;">来使用 <spanstyle="font-size:18px;"><atarget="_blank"rel="nofollow">mybatis增强工具包mybatis-plus【点击】<spanstyle="font-size:18px;"> 吧不需要你自己处理这些问题,配置搞定了一切ok我去,还有这么牛逼的玩意啊

    2020-06-09 15:46:52
    赞同 展开评论