我正在尝试使用以下代码从eclipse运行emr集群:
RunJobFlowRequest runFlowRequest = new RunJobFlowRequest()
.withName("ExtractCollocations" + UUID.randomUUID())
.withInstances(instances)
.withSteps(countStepConfig1, countStepConfig2, countStepConfig3, countStepConfig4)
.withLogUri("s3n://"+ Bucket_name + "/logs/")
.withServiceRole("EMR_DefaultRole")
.withJobFlowRole("EMR_EC2_DefaultRole");
并收到错误:
Exception in thread "main" java.lang.NoSuchMethodError: com.amazonaws.services.elasticmapreduce.model.RunJobFlowRequest.withServiceRole(Ljava/lang/String;)Lcom/amazonaws/services/elasticmapreduce/model/RunJobFlowRequest;
at LocalApp.runCluster(LocalApp.java:213)
at LocalApp.main(LocalApp.java:52)
如果我删除行“withServiceRole(”EMR_DefaultRole“)”它要求服务角色
答案 0 :(得分:0)
显然问题出在maven项目上。 我已经开通了新的AWS Java Project,但它确实有效。