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.至此,问题得到了圆满解决,没有了警告,也没有了错误