Java Exception when creating or writing files on mounted HDFS -


now working project written using java,and hava need use hdfs storage files created.so mounted hdfs local filesystem,but got problerms using mounted hdfs.when program creating or writing files mounted hdfs,i got exceptions.so made demo test,and errors well.the code below:

    package test;  import java.io.file; import java.io.ioexception;  public class test {      /**      * @param args      */     public static void main(string[] args) {         // todo auto-generated method stub         file f = new file("/mnt/hdfs/test");         try {             system.out.println(f.createnewfile());         } catch (ioexception e) {             // todo auto-generated catch block             e.printstacktrace();         }      }  } 

the exceptions here:

java.io.ioexception: unknown error 524     @ java.io.unixfilesystem.createfileexclusively(native method)     @ java.io.file.createnewfile(file.java:883)     @ test.test.main(test.java:15) 

i have rw permission mounted hdfs,and can create directories using jdk api(not hadoop api) ,now question if can create or write files via jdk api? have done this?and if so,what should make possible?


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -