phoenix操作hbase报异常java.lang.ClassNotFoundException: org.iq80.snappy.CorruptionException

参考:https://issues.apache.org/jira/browse/PHOENIX-1468

http://blog.csdn.net/zhifeiyu2008/article/details/47443271?locationNum=7&fps=1  

环境:hadoop2.7.3 

   hbase1.3.1

在phoenix中使用join(sql:select s.id,c.id from shop s inner joincomment c on s.id=c.shopid)执行表连接操作时,报如下错:

       Caused by: java.lang.NoClassDefFoundError: org/iq80/snappy/CorruptionException

       at java.lang.Class.forName0(Native Method)

       at java.lang.Class.forName(Class.java:264)

       at org.apache.phoenix.coprocessor.ServerCachingEndpointImpl.addServerCache(ServerCachingEndpointImpl.java:71)

       ...9 more

Caused by:java.lang.ClassNotFoundException: org.iq80.snappy.CorruptionException

       at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

       at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)

       at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

       ...12 more

       at org.apache.hadoop.hbase.ipc.RpcClientImpl.call(RpcClientImpl.java:1270)

       at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:227)

       at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:336)

       at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$BlockingStub.execService(ClientProtos.java:35420)

       at org.apache.hadoop.hbase.protobuf.ProtobufUtil.execService(ProtobufUtil.java:1690)

       ...13 more

    错误原因:hbase的lib目录下缺少phoenix的phoenix-4.11.0-HBase-1.3-server.jar,一开始在hbase的lib目录下只添加了phoenix-core-4.11.0-HBase-1.3.jar。两个jar包都添加后,重启hbase,执行成功。试了试,在这两个jar包只有一个在的情况下,其他的sql都可以执行成功,测试到的只有join失败,所以保险起见,还是一开始的时候,两个都添加吧。

你可能感兴趣的:(大数据)