1.警告实例
警告: 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
三月 25, 2018 4:46:58 下午 com.alibaba.com.caucho.hessian.io.SerializerFactory getDeserializer
2在表现层只引入pageHelper依赖
com.github.pagehelper
pagehelper
–>
后,出现了以下错误:
严重: Servlet.service() for servlet [springmvc] in context with path [] threw exception [Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method findPage in the service com.pinyougou.sellergoods.service.BrandService. Tried 3 times of the providers [192.168.56.1:20881] (1/1) from the registry 192.168.25.132:2181 on the consumer 192.168.56.1 using the dubbo version 2.8.4. Last error is: Failed to invoke remote method: findPage, provider: dubbo://192.168.56.1:20881/com.pinyougou.sellergoods.service.BrandService?anyhost=true&application=pinyougou-manager-web&check=false&dubbo=2.8.4&generic=false&interface=com.pinyougou.sellergoods.service.BrandService&methods=update,findOne,findAll,delete,findPage,add&pid=9012&revision=0.0.1-SNAPSHOT&side=consumer×tamp=1543136174185, 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:2585)
at java.lang.Class.getConstructor0(Class.java:2885)
at java.lang.Class.newInstance(Class.java:350)
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.JavaDeserializerObjectFieldDeserializer.deserialize(JavaDeserializer.java:396)atcom.alibaba.com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:233)atcom.alibaba.com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:157)atcom.alibaba.com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2067)atcom.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1592)atcom.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1576)atcom.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectInput.readObject(Hessian2ObjectInput.java:94)atcom.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectInput.readObject(Hessian2ObjectInput.java:99)atcom.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:85)atcom.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:117)atcom.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.decodeBody(DubboCodec.java:98)atcom.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:134)atcom.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:95)atcom.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.decode(DubboCountCodec.java:46)atcom.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapter ObjectFieldDeserializer.deserialize(JavaDeserializer.java:396) at com.alibaba.com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:233) at com.alibaba.com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:157) at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2067) at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1592) at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1576) at com.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectInput.readObject(Hessian2ObjectInput.java:94) at com.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectInput.readObject(Hessian2ObjectInput.java:99) at com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:85) at com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:117) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.decodeBody(DubboCodec.java:98) at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:134) at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:95) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.decode(DubboCountCodec.java:46) at com.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapterObjectFieldDeserializer.deserialize(JavaDeserializer.java:396)atcom.alibaba.com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:233)atcom.alibaba.com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:157)atcom.alibaba.com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2067)atcom.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1592)atcom.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1576)atcom.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectInput.readObject(Hessian2ObjectInput.java:94)atcom.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectInput.readObject(Hessian2ObjectInput.java:99)atcom.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:85)atcom.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:117)atcom.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.decodeBody(DubboCodec.java:98)atcom.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:134)atcom.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:95)atcom.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.decode(DubboCountCodec.java:46)atcom.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapterInternalDecoder.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.DeadLockProofWorker1.run(DeadLockProofWorker.java:42)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)atjava.util.concurrent.ThreadPoolExecutor 1.run(DeadLockProofWorker.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor1.run(DeadLockProofWorker.java:42)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)atjava.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
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
3.经分析得知,mybatis的分页pagehelper插件依赖于mybatis的相关jar包,因此终极的解决办法是在表现层同时加入分页pagehelper的jar包和mybatis的相关jar包,如下
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
</dependency>
<dependency>
<groupId>com.github.miemiedev</groupId>
<artifactId>mybatis-paginator</artifactId>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
</dependency>
4.最后没有了警告,也没有了错误