I have a Java program trying to load data to HDFS:
public class CopyFileToHDFS {
public static void main(String[] args) {
try{
Configuration configuration = new Configuration();
String msg = "message1";
String file = "hdfs://localhost:8020/user/user1/input.txt";
FileSystem hdfs = FileSystem.get(new URI(file), configuration);
FSDataOutputStream outputStream = hdfs.create(new Path(file), true);
outputStream.write(msg.getBytes());
}
catch(Exception e){
System.out.println(e.getMessage());
}
}
}
When I run the program, it gives me an error:
java.util.ServiceConfigurationError: org.apache.hadoop.fs.FileSystem: Provider org.apache.hadoop.fs.s3.S3FileSystem not found
It looks like some configuration issues. Can anyone give me some suggestions?
Thanks