hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anisio Mendes Lacerda" <anis...@gmail.com>
Subject Re: Error msg: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration
Date Fri, 04 Apr 2008 19:46:39 GMT
Thanks a lot for help. Only for register I would like to post which
enviroment variables
I set:

export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.13
export OS_NAME=linux
export OS_ARCH=i386
export LIBHDFS_BUILD_DIR=/mnt/hd1/hadoop/hadoop-0.14.4/libhdfs
export SHLIB_VERSION=1

export HADOOP_HOME=/mnt/hd1/hadoop/hadoop-0.14.4
export HADOOP_CONF_DIR=/mnt/hd1/hadoop/hadoop-0.14.4/conf
export HADOOP_LOG_DIR=/mnt/hd1/hadoop/hadoop-0.14.4/logs

export
LD_LIBRARY_PATH=/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/server:/mnt/hd1/hadoop/hadoop-0.14.4/libhdfs

export
CLASSPATH=/mnt/hd1/hadoop/hadoop-0.14.4/hadoop-0.14.4-core.jar:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/server:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/client:/usr/share/java:/usr/share/java/commons-logging-api.jar:/usr/share/java/:/usr/share/java/commons-logging.jar:/usr/share/java/log4j-1.2.jar

export
HADOOP_CLASSPATH=/mnt/hd1/hadoop/hadoop-0.14.4/hadoop-0.14.4-core.jar:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/server:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/client:/usr/share/java:/usr/share/java/commons-logging-api.jar:/usr/share/java/:/usr/share/java/commons-logging.jar:/usr/share/java/log4j-1.2.jar

See you,

Anisio


On Thu, Apr 3, 2008 at 8:51 AM, Peeyush Bishnoi <peeyushb@yahoo-inc.com>
wrote:

> Hello ,
>
> As this problem is related to CLASSPATh of hadoop , so just set the
> HADOOP_CLASSPATH or CLASSPATH with hadoop core jar
>
> ---
> Peeyush
>
>
> On Wed, 2008-04-02 at 13:51 -0300, Anisio Mendes Lacerda wrote:
>
> > Hi,
> >
> > me and my coleagues are implementing a small search engine in my
> University
> > Laboratory,
> > and we would like to use Hadoop as file system.
> >
> > For now we are having troubles in running the following simple code
> example:
> >
> > ================================================
> > #include "hdfs.h"
> > int main(int argc, char **argv) {
> >     hdfsFS fs = hdfsConnect("apolo.latin.dcc.ufmg.br", 51070);
> >     if(!fs) {
> >         fprintf(stderr, "Oops! Failed to connect to hdfs!\n");
> >         exit(-1);
> >     }
> >     int result = hdfsDisconnect(fs);
> >     if(!result) {
> >         fprintf(stderr, "Oops! Failed to connect to hdfs!\n");
> >         exit(-1);
> >     }
> > }
> > ================================================
> >
> > The error msg is:
> >
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > org/apache/hadoop/conf/Configuration
> >
> > ================================================
> >
> > We configured the following enviroment variables:
> >
> > export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.13
> > export OS_NAME=linux
> > export OS_ARCH=i386
> > export LIBHDFS_BUILD_DIR=/mnt/hd1/hadoop/hadoop-0.14.4/libhdfs
> > export SHLIB_VERSION=1
> >
> > export HADOOP_HOME=/mnt/hd1/hadoop/hadoop-0.14.4
> > export HADOOP_CONF_DIR=/mnt/hd1/hadoop/hadoop-0.14.4/conf
> > export HADOOP_LOG_DIR=/mnt/hd1/hadoop/hadoop-0.14.4/logs
> >
> > The following commands were used to compile the codes:
> >
> > In directory: hadoop-0.14.4/src/c++/libhdfs
> >
> > 1 - make all
> > 2 - gcc -I/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/include/ -c
> my_hdfs_test.c
> > 3 - gcc my_hdfs_test.o -I/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/include/
> > -L/mnt/hd1/hadoop/hadoop-0.14.4/libhdfs -lhdfs
> > -L/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/server -ljvm  -o
> > my_hdfs_test
> >
> > Obs:
> >
> > The hadoop file system seems to be ok once we can run commands like
> this:
> >
> > hadoop@apolo:/mnt/hd1/hadoop/hadoop-0.14.4$ bin/hadoop dfs -ls
> > Found 0 items
> >
> >
> >
> >
> >
> >
>



-- 
[]s

Anisio Mendes Lacerda

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message