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

Switch to Threaded View
Hadoop >> mail # user >> core-site.xml file is being ignored by new Configuration()

Copy link to this message
core-site.xml file is being ignored by new Configuration()
Hi guys:

I've finally extracted my problem of loading a special filesystem
into a unit test.

Below, clearly, Im creating a raw configuration and adding a single
resource to it (core-site.xml).

Afterwards, i print to confirm that the file exists.

Finally, I try to create a FileSystem from that file.  However, no file
system is created :(.

Any thoughts on why this core-site.xml file is being ignoreed?
To note: I've also tried putting core-site.xml in the working directory,
and in a local conf/ directory.  This absolute path was a last effort to
really confirm that the local path wasn't somehow being mangled by the
junit runtime.

    public void test() throws Exception{
        Configuration conf = new Configuration(false);
        System.out.println("File exists : " + theXMLFile.length());
        System.out.println("file sytem " + conf.get("fs.default.name"));
        System.out.println("Working directory = " +
        org.apache.hadoop.fs.FileSystem fs org.apache.hadoop.fs.FileSystem.get(conf);
        System.out.println("before test filesystem = " + fs);

Jay Vyas