New Contributor
Posts: 5
Registered: ‎01-18-2015

Error accessing to HDFS (CDH 5.4) from Java. Block Missing.

I just installed CDH5.4 Sandbox and trying to access to HDFS from Java getting this error:


log4j:WARN See for more info.
org.apache.hadoop.hdfs.BlockMissingException: Could not obtain block: BP-545953227- file=/tmp/b.txt
at org.apache.hadoop.hdfs.DFSInputStream.chooseDataNode(
at org.apache.hadoop.hdfs.DFSInputStream.blockSeekTo(


I have another VM (CDH 5.3) and it's working just incluing in the classpath the core-site.xml and hdfs-site.xml with the same code, so it seems that something is wrong in that VM (5.4)

I can read "b.txt" with hadoop fs -cat /tmp/b.txt so the file is right.

I have been checking the state of HDFS with hadoop fsck and dfsadmin and there're not missed blocks.

I included as well the hostname/ip in the hosts file in Windows.


What's it wrong?? any clue?