You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Wellington Chevreuil (Jira)" <ji...@apache.org> on 2019/11/05 15:17:00 UTC

[jira] [Created] (HBASE-23255) CLI hbase command prints ERROR when hadoop is set in OS path

Wellington Chevreuil created HBASE-23255:
--------------------------------------------

             Summary: CLI hbase command prints ERROR when hadoop is set in OS path
                 Key: HBASE-23255
                 URL: https://issues.apache.org/jira/browse/HBASE-23255
             Project: HBase
          Issue Type: Bug
    Affects Versions: 3.0.0, 2.3.0, 2.2.3
            Reporter: Wellington Chevreuil
            Assignee: Wellington Chevreuil


When _hadoop_ is set on the OS path, _hbase_ CLI command prints below error, before processing and executing related option:

{noformat}
[root@hbase01 hbase-3.0.0-SNAPSHOT]# bin/hbase version
Error: Could not find or load main class org.apache.hadoop.hbase.util.GetJavaProperty
HBase 3.0.0-SNAPSHOT
Source code repository git://ChevreuilWellington/Users/wellingtonchevreuil/Projects/hbase/hbase revision=bb83e423cc6c2102df98e78e864ce1f92e597d31
Compiled by wellingtonchevreuil on Wed Oct  9 11:09:25 BST 2019
From source with checksum 4f90bf3a8ec77da34a0a9929a5e794f308f52a0bd644c727b39c7faccb4a68a022e2ddb8be453596fe4312b7e3de19b48ba80c0200606b97ab1bec0f24f06f7d
{noformat}

This is non critical, though, since even with the above error, command is still executed properly.

It seems we are specifying the wrong path for hbase jars [here|https://github.com/apache/hbase/blob/master/bin/hbase#L191], causing none of the jars to be loaded in _CLASSPATH_ variable, at this point.

Then, when hadoop is detected to be in the script path, it enters this _if_ and tries to execute _org.apache.hadoop.hbase.util.GetJavaProperty_ [here|https://github.com/apache/hbase/blob/master/bin/hbase#L322], but _hbase-server_ jar is not in the CLASSPATH yet.

This is sorted by fixing the jars path mentioned above as follows:
{noformat}
diff --git a/bin/hbase b/bin/hbase
index a69ad6d1ad..f1dc5e36c6 100755
--- a/bin/hbase
+++ b/bin/hbase
@@ -188,7 +188,7 @@ if [ -d "$HBASE_HOME/hbase-server/target/hbase-webapps" ]; then
 fi
 
 #add the hbase jars for each module
-for f in $HBASE_HOME/hbase-jars/hbase*.jar; do
+for f in $HBASE_HOME/lib/hbase*.jar; do
        if [[ $f = *sources.jar ]]
   then
     : # Skip sources.jar
{noformat}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)