mybatis分页警告真正解决方法:Hessian/Burlap: 'com.github.pagehelper.Page' is an unknown class in WebappClasss

mybatis分页警告:Hessian/Burlap: ‘com.github.pagehelper.Page’ is an unknown class in WebappClasss解决办法

1.今天在使用springmvc+mybatis分页插件pagehelper时,在业务层引用了mybatis的分页插件的jar包

com.github.pagehelper
pagehelper
–>
但是表现层接收时没有引用,所以会报这样的警告:
警告: Hessian/Burlap: ‘com.github.pagehelper.Page’ is an unknown class in WebappClassLoader
context:
delegate: false
repositories:
----------> Parent Classloader:
ClassRealm[plugin>org.apache.tomcat.maven:tomcat7-maven-plugin:2.2, parent: sun.misc.Launcher$AppClassLoader@ec6b00]
java.lang.ClassNotFoundException: com.github.pagehelper.Page

2.因此百度了多篇博客,说是需要在表现层也引入pagehelper的jar包,
<dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> </dependency>
但是在表现层引入后出现了以下错误:
java.lang.NoClassDefFoundError: org/apache/ibatis/session/RowBounds

3.经分析得知,mybatis的分页pagehelper插件依赖于mybatis的相关mybatis-paginator 的jar包,因此终极的解决办法是在表现层同时加入分页pagehelper的jar包和mybatis的相关 mybatis-paginator 的jar包,如下:

<dependency>
		<groupId>com.github.miemiedev</groupId>
		<artifactId>mybatis-paginator</artifactId>
	</dependency>
	<dependency>
		<groupId>com.github.pagehelper</groupId>
		<artifactId>pagehelper</artifactId>
	</dependency>

4.至此,问题得到了圆满解决,没有了警告,也没有了错误

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据引用和引用的内容,com.github.pagehelper:pagehelper5.0可能会导致ClassNotFoundException: mysql错误。在引用中提到,版本不兼容可能是导致问题的原因之一。你使用的是mysql 8.0.24版本,而com.github.pagehelper:pagehelper5.0可能适用于mysql 5.0及以下版本。因此,你需要确认你的pagehelper版本是否与你使用的mysql版本兼容。你可以尝试使用适用于mysql 8.0.24版本的pagehelper版本来解决这个问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [Caused by: java.lang.ClassCastException: class com.github.pagehelper.PageHelper cannot be cast to cl](https://blog.csdn.net/sm923/article/details/118704108)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [mybatis使用pagehelper分页报错java.lang.ClassCastException: com.github.pagehelper.PageHelper cannot ...](https://blog.csdn.net/Baymax0912/article/details/109318367)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值