使用java api为Amazon Elastic bean创建新的应用程序版本现有应用程序

时间:2014-02-13 07:49:59

标签: amazon-web-services elastic-beanstalk

我正在尝试通过java api和命令行参数自动化为现有弹性beanstalk应用程序创建应用程序版本。

在实现AWSElasticBeanstalkClient的createApplicationVersion()时,我收到以下代码snipplet的错误。 注意:我将AWSElasticBeanstalkClient的端点作为US East-1(N.Virginia)或现有应用程序的环境URL传递。

    ArrayList<String> s3SourceBundleList = AmazonS3BucketUploadApp.doBucketUploadFromLocal(sourceLocation);
    String bucketName = s3SourceBundleList.get(0);
    String keyName = java.net.URLEncoder.encode(s3SourceBundleList.get(1), "UTF-8");
    //String keyName = s3SourceBundleList.get(1);
    S3Location s3SourceBundle = new S3Location();
    s3SourceBundle.setS3Bucket(bucketName);
    s3SourceBundle.setS3Key(keyName);
    createApplicationVersionRequest.setSourceBundle(s3SourceBundle);
    createApplicationVersionRequest.setDescription("New version");

    appVersionResultObject = awsBeanstalkclient.createApplicationVersion(createApplicationVersionRequest); 

错误:

com.amazonaws.AmazonClientException: Unable to unmarshall response (ParseError at [row,col]:[6,1]

还有一个错误

AWS service: AmazonElasticBeanstalk AWS Request ID: null AWS service unavailable.

请为此提出任何解决方案。

1 个答案:

答案 0 :(得分:0)

如何初始化客户端(检查日志输出 - 启用记录器org.apache.http.wire到TRACE可能会有帮助)?

如果您想要一个想法,请查看此来源:

https://github.com/jenkinsci/awseb-deployment-plugin/blob/master/src/main/java/br/com/ingenieux/jenkins/plugins/awsebdeployment/Deployer.java

它包含构建和部署到AWS EB所需的全部内容:)