Grokbase Groups HBase user May 2016
FAQ
Please use user@hbase for future correspondence.

Here is related code from ZooKeeperWatcher (NPE seems to have come from the
for loop):

   public List<String> getMetaReplicaNodes() throws KeeperException {
     List<String> childrenOfBaseNode = ZKUtil.listChildrenNoWatch(this,
baseZNode);
     List<String> metaReplicaNodes = new ArrayList<String>(2);
     String pattern =
conf.get("zookeeper.znode.metaserver","meta-region-server");
     for (String child : childrenOfBaseNode) {

ZKUtil.listChildrenNoWatch() would return null if the base znode doesn't
exist.

The error message you mentioned still exists:

hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionManager.java:
            + "There could be a mismatch with the one configured in the
master.";
hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/MetaTableLocator.java:
            + "There could be a mismatch with the one configured in the
master.";

With zookeeper.znode.parent properly set, do you still experience NPE with
your code ?

Thanks
On Fri, May 27, 2016 at 5:53 AM, Pablo Leira wrote:

Hi,

I have just updated a client of hbase from version 0.96.2-hadoop2 to 1.2.1
(hbase-client).
With the old version with the property zookeeper.znode.parent of the file
hbase-site.xml bad configured (p.e. with the value "hbase" instead of
"hbase-secure"
our "hbase-unsecure" ) . I was obtaining the following error:

“The node /hbase (/hbase-unsecure or /hbase-secure) is not in ZooKeeper. It
should have been written by the master. Check the value configured in
'zookeeper.znode.parent'. There could be a mismatch with the one configured
in the master.“


But with the new version I was obtaining the following trace:

java.lang.RuntimeException: java.lang.NullPointerException at

org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:208)
at
org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:326)
at

org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:301)
at

org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:166)
at
org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:161)
at org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:794) at

org.apache.hadoop.hbase.MetaTableAccessor.fullScan(MetaTableAccessor.java:602)
at

org.apache.hadoop.hbase.MetaTableAccessor.tableExists(MetaTableAccessor.java:366)
at
org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:403)
at

com.denodo.connect.hadoop.hbase.HBaseConnector.doRun(HBaseConnector.java:198)
at

com.denodo.connect.hadoop.hdfs.wrapper.AbstractSecureHadoopWrapper.run(AbstractSecureHadoopWrapper.java:110)
at com.denodo.vdb.misc.datasource.MyDataSource$1$1.doRun(Unknown Source) at
com.denodo.vdb.engine.wrapper.raw.my.MyAccessImpl.doRun(Unknown Source) at
com.denodo.vdb.engine.wrapper.RawAccess.run(Unknown Source) at
com.denodo.vdb.engine.thread.g.a(Unknown Source) at
com.denodo.vdb.engine.thread.ReusableThread.run(Unknown Source) Caused by:
java.lang.NullPointerException at

org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.getMetaReplicaNodes(ZooKeeperWatcher.java:489)
at

org.apache.hadoop.hbase.zookeeper.MetaTableLocator.blockUntilAvailable(MetaTableLocator.java:558)
at

org.apache.hadoop.hbase.client.ZooKeeperRegistry.getMetaRegionLocation(ZooKeeperRegistry.java:61)
at

org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateMeta(ConnectionManager.java:1211)
at

org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateRegion(ConnectionManager.java:1178)
at

org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:305)
at

org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:156)
at

org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:60)
at

org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:200)
... 15 more


This is my code:


final Configuration hbaseConfig = getHBaseConfig(inputValues); /**
Connection to the cluster. A single connection shared by all application
threads. */ Connection connection = null; /** A lightweight handle to a
specific table. Used from a single thread. */ Table table = null; try {
final TableName tableName =
TableName.valueOf(inputValues.get(ParameterNaming.CONF_TABLE_NAME));
connection = ConnectionFactory.createConnection(hbaseConfig); Admin admin =
connection.getAdmin(); if (!admin.tableExists(tableName)) {


The last line where the exception is thrown.

Are there any way to obtain a exception more specific than
NullPointerException, because in the previous version this exception it was
more descriptive. Or maybe my code is not correct.

Thanks
Regards
Pablo

Search Discussions

  • Pablo Leira at May 31, 2016 at 1:48 am
    Hi,

    If the value of zookeeper.znode.parent is "hbase-unsecure" works right. But
    if the value is "/hbase" ou "/hbase-secure" I experiment NPE.

    Thanks and sorry for not using the proper list.
    Pablo


    2016-05-28 17:57 GMT+02:00 Ted Yu <yuzhihong@gmail.com>:
    Please use user@hbase for future correspondence.

    Here is related code from ZooKeeperWatcher (NPE seems to have come from
    the for loop):

    public List<String> getMetaReplicaNodes() throws KeeperException {
    List<String> childrenOfBaseNode = ZKUtil.listChildrenNoWatch(this,
    baseZNode);
    List<String> metaReplicaNodes = new ArrayList<String>(2);
    String pattern =
    conf.get("zookeeper.znode.metaserver","meta-region-server");
    for (String child : childrenOfBaseNode) {

    ZKUtil.listChildrenNoWatch() would return null if the base znode doesn't
    exist.

    The error message you mentioned still exists:

    hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionManager.java:
    + "There could be a mismatch with the one configured in the
    master.";
    hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/MetaTableLocator.java:
    + "There could be a mismatch with the one configured in the
    master.";

    With zookeeper.znode.parent properly set, do you still experience NPE
    with your code ?

    Thanks
    On Fri, May 27, 2016 at 5:53 AM, Pablo Leira wrote:

    Hi,

    I have just updated a client of hbase from version 0.96.2-hadoop2 to 1.2.1
    (hbase-client).
    With the old version with the property zookeeper.znode.parent of the file
    hbase-site.xml bad configured (p.e. with the value "hbase" instead of
    "hbase-secure"
    our "hbase-unsecure" ) . I was obtaining the following error:

    “The node /hbase (/hbase-unsecure or /hbase-secure) is not in ZooKeeper.
    It
    should have been written by the master. Check the value configured in
    'zookeeper.znode.parent'. There could be a mismatch with the one
    configured
    in the master.“


    But with the new version I was obtaining the following trace:

    java.lang.RuntimeException: java.lang.NullPointerException at

    org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:208)
    at
    org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:326)
    at

    org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:301)
    at

    org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:166)
    at

    org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:161)
    at org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:794) at

    org.apache.hadoop.hbase.MetaTableAccessor.fullScan(MetaTableAccessor.java:602)
    at

    org.apache.hadoop.hbase.MetaTableAccessor.tableExists(MetaTableAccessor.java:366)
    at
    org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:403)
    at

    com.denodo.connect.hadoop.hbase.HBaseConnector.doRun(HBaseConnector.java:198)
    at

    com.denodo.connect.hadoop.hdfs.wrapper.AbstractSecureHadoopWrapper.run(AbstractSecureHadoopWrapper.java:110)
    at com.denodo.vdb.misc.datasource.MyDataSource$1$1.doRun(Unknown Source)
    at
    com.denodo.vdb.engine.wrapper.raw.my.MyAccessImpl.doRun(Unknown Source) at
    com.denodo.vdb.engine.wrapper.RawAccess.run(Unknown Source) at
    com.denodo.vdb.engine.thread.g.a(Unknown Source) at
    com.denodo.vdb.engine.thread.ReusableThread.run(Unknown Source) Caused by:
    java.lang.NullPointerException at

    org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.getMetaReplicaNodes(ZooKeeperWatcher.java:489)
    at

    org.apache.hadoop.hbase.zookeeper.MetaTableLocator.blockUntilAvailable(MetaTableLocator.java:558)
    at

    org.apache.hadoop.hbase.client.ZooKeeperRegistry.getMetaRegionLocation(ZooKeeperRegistry.java:61)
    at

    org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateMeta(ConnectionManager.java:1211)
    at

    org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateRegion(ConnectionManager.java:1178)
    at

    org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:305)
    at

    org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:156)
    at

    org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:60)
    at

    org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:200)
    ... 15 more


    This is my code:


    final Configuration hbaseConfig = getHBaseConfig(inputValues); /**
    Connection to the cluster. A single connection shared by all application
    threads. */ Connection connection = null; /** A lightweight handle to a
    specific table. Used from a single thread. */ Table table = null; try {
    final TableName tableName =
    TableName.valueOf(inputValues.get(ParameterNaming.CONF_TABLE_NAME));
    connection = ConnectionFactory.createConnection(hbaseConfig); Admin admin
    =
    connection.getAdmin(); if (!admin.tableExists(tableName)) {


    The last line where the exception is thrown.

    Are there any way to obtain a exception more specific than
    NullPointerException, because in the previous version this exception it
    was
    more descriptive. Or maybe my code is not correct.

    Thanks
    Regards
    Pablo

    --

    *Pablo Leira Canedo*
    Service Engineering
    Denodo Technologies
    (+34) 981 100 200 Phone
    (+34) 981 100 205 Fax
    pleira@denodo.com
    <http://briefcase.denodo.com/content/operations/Document%20Templates/Email%20Signatures/DT-STAFF-TPL-en-Standard%20Email%20Signature-20141003-medium.html#>
    www.denodo.com
    15011 A Coruña, Galicia
    Spain
    Legal Notice
    The message is intended for the addresses only and its contents and any
    attached files are strictly confidential.
    If you have received it in error, please remove this mail and contact
    postmaster@denodo.com.
    Thank you.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categorieshbase, hadoop
postedMay 28, '16 at 3:58p
activeMay 31, '16 at 1:48a
posts2
users2
websitehbase.apache.org

2 users in discussion

Ted Yu: 1 post Pablo Leira: 1 post

People

Translate

site design / logo © 2018 Grokbase