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 Error msg: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration
Date Wed, 02 Apr 2008 16:51:33 GMT
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