Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hadoop, mail # user - JNI and calling Hadoop jar files


Copy link to this message
-
JNI and calling Hadoop jar files
Saptarshi Guha 2009-03-24, 02:12
Hello,
I'm using some JNI interfaces, via a R. My classpath contains all the
jar files in $HADOOP_HOME and $HADOOP_HOME/lib
My class is
    public SeqKeyList() throws Exception {

config = new  org.apache.hadoop.conf.Configuration();
config.addResource(new Path(System.getenv("HADOOP_CONF_DIR")
   +"/hadoop-default.xml"));
config.addResource(new Path(System.getenv("HADOOP_CONF_DIR")
   +"/hadoop-site.xml"));

System.out.println("C="+config);
filesystem = FileSystem.get(config);
System.out.println("C="+config+"F=" +filesystem);
System.out.println(filesystem.getUri().getScheme());

    }

I am using a distributed filesystem
(org.apache.hadoop.hdfs.DistributedFileSystem for fs.hdfs.impl).
When run from the command line and this class is created everything works fine
When called using jni I get
 java.lang.ClassNotFoundException: org.apache.hadoop.hdfs.DistributedFileSystem

Is this a jni issue? How can it work from the commandline using the
same classpath, yet throw this is exception when run via JNI?
Saptarshi Guha