pagehelper分页插件报错
pagehelper分页插件报错
‘com.github.pagehelper.Page’ is an unknown class in WebappClassLoader
警告: 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: [email protected]]
:
java.lang.ClassNotFoundException: com.github.pagehelper.Page
报错原因
web端没有引入pagehelper依赖
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
</dependency>
引入依赖后,又报错java.lang.NoClassDefFoundError: org/apache/ibatis/session/RowBounds
严重: Servlet.service() for servlet [xx-xx-web] in context with path [] threw exception [Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method getItemList in the service com.taotao.service.ItemService. Tried 3 times of the providers [192.168.170.1:20880] (1/1) from the registry 127.0.0.1:2181 on the consumer 192.168.170.1 using the dubbo version 2.5.3. Last error is: Failed to invoke remote method: getItemList, provider: dubbo://192.168.170.1:20880/com.taotao.service.ItemService?anyhost=true&application=taotao-manager-web&check=false&dubbo=2.5.3&interface=com.taotao.service.ItemService&methods=addItem,getItemList,getItemById&pid=12236&revision=0.0.1-SNAPSHOT&side=consumer&timeout=300000×tamp=1558576471460, cause: java.lang.NoClassDefFoundError: org/apache/ibatis/session/RowBounds
java.lang.NoClassDefFoundError: org/apache/ibatis/session/RowBounds
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.newInstance(Class.java:412)
at com.alibaba.com.caucho.hessian.io.CollectionDeserializer.createList(CollectionDeserializer.java:107)
at com.alibaba.com.caucho.hessian.io.CollectionDeserializer.readLengthList(CollectionDeserializer.java:88)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1628)
at com.alibaba.com.caucho.hessian.io.JavaDeserializerInternalDecoder.messageReceived(NettyCodecAdapter.java:134)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.jboss.netty.util.internal.DeadLockProofWorkerWorker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.apache.ibatis.session.RowBounds
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
… 37 more
] with root cause
新报错原因
缺少mybatis依赖
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</dependency>
重新引入依赖不报错了
最终解决方案
同时引入pagehelper和mybatis依赖
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</dependency>
有不对的请大家指出!
推荐阅读
-
PHP+jQuery+Ajax实现分页效果 jPaginate插件的应用
-
bootstrap datetimepicker 日期插件在火狐下出现一条报错信息的原因分析及解决办法
-
vue中的自定义分页插件组件的示例
-
java使用插件pagehelper在mybatis中实现分页查询
-
thinkphp5配合datatable插件分页后端处理程序
-
Vue引用Swiper4插件无法重写分页器样式的解决方法
-
jQuery插件分享之分页插件jqPagination
-
SSM框架手动实现分页逻辑(非PageHelper)
-
VUEJS实战之利用laypage插件实现分页(3)
-
jQuery Pagination分页插件使用方法详解