Distributed Cache functionality

Hi, I tried to use Distributed Cache in Java MR program but it did not ran successfully.

Driver class:
DistributedCache.addCacheFile(new URI(“hdfs://nn01.itversity.com:8020/user/ahsan456/cache_files/designation.txt”),conf);

And in Mapper Class :slight_smile:
private HashMap<String,Double> desg_map = new HashMap<String, Double>() ;
protected void setup(Context context) throws IOException, InterruptedException {

    BufferedReader br  ;
    Path[] localFiles =  DistributedCache.getLocalCacheFiles(context.getConfiguration()) ;
    String record  ;

    for(Path path : localFiles){
            br = new BufferedReader(new FileReader(path.toString()));
            record = br.readLine();
            while(record != null){
                String[] data = record.split(",") ;
                record = br.readLine() ;


Error: Null Pointer Exception in MyMapper at below line:
for(Path path : localFiles){

Am I using the correct URI scheme ? If not please let me know the correct uri for the same.
The file is on hdfs and accessible by the same uri :

Please suggest!!