I want to use libhdfs for writing into and reading from HDFS. I have the release version hadoop2.5.0. What I am trying to do is to compile and the run the code they have provided as test, The code compiles fine,here is what I do
gcc -I/usr/lib/jvm/java-7-openjdk-amd64/include test/test_libhdfs_ops.c -o test.o -lhdfs -L .
but whenever I tried to run it, I get the following error,
unable to get stack trace for java.lang.NoClassDefFoundError exception: ExceptionUtils::getStackTrace error.
I realized that it is unable to link to some jar file for the java classes, found similar issues here Writing files in hdfs in C++ (libhdfs) and here Hadoop 2.0 JAR files, tried to resolve them but no success. here's what I have set as my CLASSPATH env variable
CLASSPATH=$HADOOP_HOME/share/hadoop/common/:$HADOOP_HOME/share/hadoop/hdfs/:$HADOOP_HOME/share/hadoop/yarn/:$HADOOP_HOME/share/hadoop/mapreduce/:$HADOOP_HOME/share/hadoop/httpfs/:$HADOOP_HOME/share/hadoop/tools/
What am I missing here?