• NoClassDefFoundError: Could not initialize class org.apache.hadoop.hbase.protobuf.ProtobufUtil


    2020-12-07 08:51:32.760 [Druid-ConnectionPool-Create-1977618945] ERROR com.alibaba.druid.pool.DruidDataSource - create connection SQLException, url: jdbc:phoenix:10.101.71.54,10.101.71.55,10.101.71.56:2181/hbase, errorCode 103, state 08004
    java.sql.SQLException: ERROR 103 (08004): Unable to establish connection.
            at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:494)
            at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:150)
            at org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:430)
            at org.apache.phoenix.query.ConnectionQueryServicesImpl.access$400(ConnectionQueryServicesImpl.java:267)
            at org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:2523)
            at org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:2499)
            at org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:76)
            at org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:2499)
            at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:255)
            at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:150)
            at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:221)
            at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1644)
            at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1710)
            at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2753)
    Caused by: java.io.IOException: java.lang.reflect.InvocationTargetException
            at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:240)
            at org.apache.hadoop.hbase.client.ConnectionManager.createConnection(ConnectionManager.java:431)
            at org.apache.hadoop.hbase.client.ConnectionManager.createConnectionInternal(ConnectionManager.java:340)
            at org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:144)
            at org.apache.phoenix.query.HConnectionFactory$HConnectionFactoryImpl.createConnection(HConnectionFactory.java:47)
            at org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:425)
            ... 11 common frames omitted

    Caused by: java.lang.reflect.InvocationTargetException: null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:238)
    ... 16 common frames omitted
    Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.hadoop.hbase.protobuf.ProtobufUtil
    at org.apache.hadoop.hbase.ClusterId.parseFrom(ClusterId.java:64)
    at org.apache.hadoop.hbase.zookeeper.ZKClusterId.readClusterIdZNode(ZKClusterId.java:75)
    at org.apache.hadoop.hbase.client.ZooKeeperRegistry.getClusterId(ZooKeeperRegistry.java:105)
    at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.retrieveClusterId(ConnectionManager.java:905)
    at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.<init>(ConnectionManager.java:648)
    ... 21 common frames omitted

     

    这个问题不是缺少了包,是jar包里的hbase-site.xml 的hbase.rootdir改正确即可。

  • 相关阅读:
    Web——[HCTF 2018]WarmUp
    栈的设置+栈的越界问题+栈的极限大小
    栈的概念
    检测点3.1
    字节型数据和字型数据的小结
    汇编语言(王爽)学习记录_第一章
    sqli-labs less-1 --> less-4
    五角星
    STD二手图书交流平台团队博客-登陆问题的解决
    STD二手图书交流平台团队博客-界面构建
  • 原文地址:https://www.cnblogs.com/z-test/p/14095622.html
Copyright © 2020-2023  润新知