Whereas all the above recommendations failed to resolve this error for me. Setting the environment variable HADOOP_BIN_PATH resolved the error for me. Also another related error where the word access0 in the error string is replaced with createDirectoryWithMode0.
If you look in the hadoop/bin folder and inspect hdfs.cmd and mapred.cmd it is clear that the HADOOP_BIN_PATH environment variable is expected. For example this code:
if not defined HADOOP_BIN_PATH (
set HADOOP_BIN_PATH=%~dp0
)
%~dp0 should expand to the folder containing the cmd file. However, you could imagine other components of hadoop such as the daemons that do not start from the command line which may also expect this environment variable to be set.
Set HADOOP_BIN_PATH to the bin folder under your hadoop directory.
If you set a user environment variable you will need to restart the process running your application. If you set a system environment variable you will need to restart Windows to see the effect.