I assume you build sample using maven.
Please check content of the JAR you're trying to run. Especially META-INFO/services
directory, file org.apache.hadoop.fs.FileSystem
. There should be list of filsystem implementation classes. Check line org.apache.hadoop.hdfs.DistributedFileSystem
is present in the list for HDFS and org.apache.hadoop.fs.LocalFileSystem
for local file scheme.
If this is the case, you have to override referred resource during the build.
Other possibility is you simply don't have hadoop-hdfs.jar
in your classpath but this has low probability. Usually if you have correct hadoop-client
dependency it is not an option.