This is an automated email from the ASF dual-hosted git repository.

busbey pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 3601129  HBASE-21458 Error: Could not find or load main class 
org.apache.hadoop.hbase.util.GetJavaProperty
3601129 is described below

commit 36011293f679e34af09f4c3eab31602a70454fb3
Author: Michael Stack <[email protected]>
AuthorDate: Thu Nov 8 10:56:59 2018 -0800

    HBASE-21458 Error: Could not find or load main class 
org.apache.hadoop.hbase.util.GetJavaProperty
    
    Signed-off-by: Sean Busbey <[email protected]>
---
 bin/hbase | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/bin/hbase b/bin/hbase
index 00017dc..d16d3f4 100755
--- a/bin/hbase
+++ b/bin/hbase
@@ -182,20 +182,11 @@ if [ -d "$HBASE_HOME/hbase-server/target/hbase-webapps" 
]; then
     add_to_cp_if_exists "${HBASE_HOME}/hbase-rest/target"
   else
     add_to_cp_if_exists "${HBASE_HOME}/hbase-server/target"
+    # Needed for GetJavaProperty check below
+    add_to_cp_if_exists "${HBASE_HOME}/hbase-server/target/classes"
   fi
 fi
 
-#add the hbase jars for each module
-for f in $HBASE_HOME/hbase-jars/hbase*.jar; do
-       if [[ $f = *sources.jar ]]
-  then
-    : # Skip sources.jar
-  elif [ -f $f ]
-  then
-    CLASSPATH=${CLASSPATH}:$f;
-  fi
-done
-
 #If avail, add Hadoop to the CLASSPATH and to the JAVA_LIBRARY_PATH
 # Allow this functionality to be disabled
 if [ "$HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP" != "true" ] ; then
@@ -316,7 +307,15 @@ fi
 
 #If configured and available, add Hadoop to the CLASSPATH and to the 
JAVA_LIBRARY_PATH
 if [ -n "${HADOOP_IN_PATH}" ] && [ -f "${HADOOP_IN_PATH}" ]; then
-  HADOOP_JAVA_LIBRARY_PATH=$(HADOOP_CLASSPATH="$CLASSPATH" "${HADOOP_IN_PATH}" 
\
+  # If built hbase, temporarily add hbase-server*.jar to classpath for 
GetJavaProperty
+  # Exclude hbase-server*-tests.jar
+  temporary_cp=
+  for f in "${HBASE_HOME}"/lib/hbase-server*.jar; do
+    if [[ ! "${f}" =~ ^.*\-tests\.jar$ ]]; then
+      temporary_cp=":$f"
+    fi
+  done
+  HADOOP_JAVA_LIBRARY_PATH=$(HADOOP_CLASSPATH="$CLASSPATH${temporary_cp}" 
"${HADOOP_IN_PATH}" \
                              org.apache.hadoop.hbase.util.GetJavaProperty 
java.library.path)
   if [ -n "$HADOOP_JAVA_LIBRARY_PATH" ]; then
     JAVA_LIBRARY_PATH=$(append_path "${JAVA_LIBRARY_PATH}" 
"$HADOOP_JAVA_LIBRARY_PATH")

Reply via email to