[ 
https://issues.apache.org/jira/browse/HBASE-4243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13113262#comment-13113262
 ] 

Lars George commented on HBASE-4243:
------------------------------------

Tested on MacOS Lion.

Patch works fine and actually triggers another bug

{noformat}
$ bin/start-hbase.sh 
ls: /projects/opensource/hadoop-0.20.2-append/hadoop-core*.jar: No such file or 
directory
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/hadoop/util/PlatformName
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
ls: /projects/opensource/hadoop-0.20.2-append/hadoop-core*.jar: No such file or 
directory
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/hadoop/util/PlatformName
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
localhost: starting zookeeper, logging to 
/projects/opensource/hbase-trunk-rw//logs/hbase-larsgeorge-zookeeper-de1-app-mbp-2.out
localhost: /projects/opensource/hadoop-0.20.2-append
localhost: ls: /projects/opensource/hadoop-0.20.2-append/hadoop-core*.jar: No 
such file or directory
localhost: Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/hadoop/util/PlatformName
localhost: Caused by: java.lang.ClassNotFoundException: 
org.apache.hadoop.util.PlatformName
localhost:      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
localhost:      at java.security.AccessController.doPrivileged(Native Method)
localhost:      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
localhost:      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
localhost:      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
localhost:      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
starting master, logging to 
/projects/opensource/hbase-trunk-rw/bin/../logs/hbase-larsgeorge-master-de1-app-mbp-2.out
/projects/opensource/hadoop-0.20.2-append
ls: /projects/opensource/hadoop-0.20.2-append/hadoop-core*.jar: No such file or 
directory
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/hadoop/util/PlatformName
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
localhost: starting regionserver, logging to 
/projects/opensource/hbase-trunk-rw//logs/hbase-larsgeorge-regionserver-de1-app-mbp-2.out
localhost: /projects/opensource/hadoop-0.20.2-append
localhost: ls: /projects/opensource/hadoop-0.20.2-append/hadoop-core*.jar: No 
such file or directory
localhost: Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/hadoop/util/PlatformName
localhost: Caused by: java.lang.ClassNotFoundException: 
org.apache.hadoop.util.PlatformName
localhost:      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
localhost:      at java.security.AccessController.doPrivileged(Native Method)
localhost:      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
localhost:      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
localhost:      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
localhost:      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
{noformat}

because of the tar ball naming of:

{noformat}
$ ll /projects/opensource/hadoop-0.20.2-append/
total 14960
drwxr-xr-x@  26 larsgeorge  staff      884 Apr 13 09:09 .
drwxr-xr-x  114 larsgeorge  staff     3876 Sep 22 19:42 ..
-rw-r--r--@   1 larsgeorge  staff   348624 Apr 13 08:58 CHANGES.txt
-rw-r--r--@   1 larsgeorge  staff    13366 Apr 13 08:58 LICENSE.txt
-rw-r--r--@   1 larsgeorge  staff      101 Apr 13 08:58 NOTICE.txt
-rw-r--r--@   1 larsgeorge  staff     1366 Apr 13 08:58 README.txt
drwxr-xr-x@  17 larsgeorge  staff      578 Apr 13 08:58 bin
-rw-r--r--@   1 larsgeorge  staff    74035 Apr 13 08:58 build.xml
drwxr-xr-x@   4 larsgeorge  staff      136 Apr 13 08:58 c++
drwxr-xr-x   18 larsgeorge  staff      612 Aug  9 15:11 conf
drwxr-xr-x@  15 larsgeorge  staff      510 Apr 13 08:58 conf.original
drwxr-xr-x@  13 larsgeorge  staff      442 Apr 13 08:58 contrib
drwxr-xr-x@  63 larsgeorge  staff     2142 Apr 13 08:58 docs
-rw-r--r--@   1 larsgeorge  staff     6839 Apr 13 08:58 hadoop-0.20.2-ant.jar
-rw-r--r--    1 larsgeorge  staff  2707920 Apr 13 09:06 hadoop-0.20.2-core.jar
-rw-r--r--@   1 larsgeorge  staff  2689741 Apr 13 08:58 
hadoop-0.20.2-core.jar.original
-rw-r--r--@   1 larsgeorge  staff   142466 Apr 13 08:58 
hadoop-0.20.2-examples.jar
-rw-r--r--@   1 larsgeorge  staff  1563859 Apr 13 08:58 hadoop-0.20.2-test.jar
-rw-r--r--@   1 larsgeorge  staff    69940 Apr 13 08:58 hadoop-0.20.2-tools.jar
drwxr-xr-x@   6 larsgeorge  staff      204 Apr 13 08:58 ivy
-rw-r--r--@   1 larsgeorge  staff     8852 Apr 13 08:58 ivy.xml
drwxr-xr-x@  30 larsgeorge  staff     1020 Jul 13 10:20 lib
drwxr-xr-x@   3 larsgeorge  staff      102 Apr 13 08:58 librecordio
drwxr-xr-x    3 larsgeorge  staff      102 May 16 09:56 logs
drwxr-xr-x@  17 larsgeorge  staff      578 Apr 13 08:58 src
drwxr-xr-x@   8 larsgeorge  staff      272 Apr 13 08:58 webapps

$ svn revert bin/hbase
Reverted 'bin/hbase'
$ killhbase 
$ bin/start-hbase.sh 
starting master, logging to 
/projects/opensource/hbase-trunk-rw/bin/../logs/hbase-larsgeorge-master-de1-app-mbp-2.out
$ 
{noformat}

So the revert of the patch fell back to the older behavior of not going through 
the if branch, which does not trigger the issue. Setting HADOOP_HOME externally 
does trigger it as expected.

PS: Please upload the patch in SVN format (i.e. using --no-prefix with git for 
example), just so that it conforms to standard

I am +1 applying the patch.

> HADOOP_HOME should be auto-detected
> -----------------------------------
>
>                 Key: HBASE-4243
>                 URL: https://issues.apache.org/jira/browse/HBASE-4243
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Roman Shaposhnik
>            Assignee: Roman Shaposhnik
>            Priority: Minor
>         Attachments: HBASE-4243-2.patch.txt, HBASE-4243.patch.txt
>
>
> Now that HBASE-3465 has been integrated, perhaps we should try to auto-detect 
> the HADOOP_HOME setting if it is not given explicitly. Something along the 
> lines of:
> {noformat}
> # check for hadoop in the path
> 141   HADOOP_IN_PATH=`which hadoop 2>/dev/null`
> 142   if [ -f ${HADOOP_IN_PATH} ]; then
> 143     HADOOP_DIR=`dirname "$HADOOP_IN_PATH"`/..
> 144   fi
> 145   # HADOOP_HOME env variable overrides hadoop in the path
> 146   HADOOP_HOME=${HADOOP_HOME:-$HADOOP_DIR}
> 147   if [ "$HADOOP_HOME" == "" ]; then
> 148     echo "Cannot find hadoop installation: \$HADOOP_HOME must be set or 
> hadoop must be in the path";
> 149     exit 4;
> 150   fi
> {noformat}
> Thoughts?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to