Git Product home page Git Product logo

aliyun-openapi-java-sdk's Introduction

English | 简体中文

Alibaba Cloud SDK for Java

Latest Stable Version

The Alibaba Cloud SDK for Java allows you to access Alibaba Cloud services such as Elastic Compute Service (ECS), Server Load Balancer (SLB), and CloudMonitor. You can access Alibaba Cloud services without the need to handle API related tasks, such as signing and constructing your requests.

This document introduces how to obtain and call Alibaba Cloud SDK for Java.

If you have any problem while using Alibaba Cloud SDK for Java, please submit an issue.

Requirements

  • To use Alibaba Cloud SDK for Java, you must have an Alibaba Cloud account as well as an AccessKey ID and an AccessKey Secret. Create and view your AccessKey on the RAM console or contact your system administrator.

  • To use the Alibaba Cloud SDK for Java to access the APIs of a product, you must first activate the product on the Alibaba Cloud console if required.

  • The Alibaba Cloud Java SDK requires JDK 1.6 or later.

Installation

If you use Apache Maven to manage Java projects, you only need to add corresponding dependencies to the pom.xml files of the projects. You can view the Maven dependencies of different cloud products in Alibaba Cloud SDK Center.

You must install aliyun-java-sdk-core library no matter which product development kit you want to use. For example, to call the ECS SDK, you need to install aliyun-java-sdk-core library and aliyun-java-sdk-ecs library .

To use the Ecs SDK as an example, you only need to declare the following two dependencies in the pom.xml file.

<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>aliyun-java-sdk-core</artifactId>
    <version>[4.6.3,5.0.0)</version>
</dependency>
<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>aliyun-java-sdk-ecs</artifactId>
    <version>[4.16.0,5.0.0)</version>
</dependency>

If maven is not downloading jar packages from a central repository, you need to add these dependencies in the pom.xml file, or a NoClassDefFoundError exception will be reported

<dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.10.1</version>
</dependency>
<dependency>
    <groupId>io.opentracing</groupId>
    <artifactId>opentracing-api</artifactId>
    <version>0.33.0</version>
</dependency>
<dependency>
    <groupId>io.opentracing</groupId>
    <artifactId>opentracing-util</artifactId>
    <version>0.33.0</version>
</dependency>

Troubleshoot

Troubleshoot Provide OpenAPI diagnosis service to help developers quickly locate and troubleshoot errors by using RequestID or error message, and provide solutions.

Quick Examples

The following code example shows the three main steps to use Alibaba Cloud SDK for Java :

  1. Create and initialize a DefaultAcsClient instance.

  2. Create an API request and set parameters.

  3. Initiate the request and handle the response or exceptions.

package com.testprogram;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.ecs.model.v20140526.*;
public class Main {
    public static void main(String[] args) {
        // Create and initialize a DefaultAcsClient instance
        DefaultProfile profile = DefaultProfile.getProfile(
            "<your-region-id>",          // The region ID
            "<your-access-key-id>",      // The AccessKey ID of the RAM account
            "<your-access-key-secret>"); // The AccessKey Secret of the RAM account
        IAcsClient client = new DefaultAcsClient(profile);
        // Create an API request and set parameters
        DescribeInstancesRequest request = new DescribeInstancesRequest();
        request.setPageSize(10);
        // Initiate the request and handle the response or exceptions
        DescribeInstancesResponse response;
        try {
            response = client.getAcsResponse(request);
            for (DescribeInstancesResponse.Instance instance:response.getInstances()) {
                System.out.println(instance.getPublicIpAddress());
            }
        } catch (ServerException e) {
            e.printStackTrace();
        } catch (ClientException e) {
            e.printStackTrace();
        }
    }
}

Documentation

Issues

Opening an Issue, Issues not conforming to the guidelines may be closed immediately.

Changelog

Detailed changes for each release are documented in the release notes.

Contribution

Please make sure to read the Contributing Guide before making a pull request.

References

License

Apache-2.0

Copyright (c) 2009-present, Alibaba Cloud All rights reserved.

aliyun-openapi-java-sdk's People

Contributors

18730298725 avatar 3139487747 avatar aliguyong avatar atptro avatar czy95czy avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar h-hg avatar huangbncly avatar jacksontian avatar jiangdeyan avatar jxyowen avatar laiwang avatar limfriend avatar liumihust avatar liyan2011 avatar malijiefoxmail avatar oldratlee avatar peze avatar qingtang-sdk avatar sdk-team avatar silent-beaters avatar sjj3086786 avatar snyk-bot avatar ssy352959096 avatar talentning avatar wuling0412 avatar yndu13 avatar zhaiyongsheng0123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aliyun-openapi-java-sdk's Issues

OSSUtils 加载 ExceptionInInitializerError

at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.util.MissingResourceException: Can't find bundle for base name common, locale en_US at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564) at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387) at java.util.ResourceBundle.getBundle(ResourceBundle.java:845) at com.aliyun.oss.common.utils.ResourceManager.<init>(ResourceManager.java:33) at com.aliyun.oss.common.utils.ResourceManager.getInstance(ResourceManager.java:37) at com.aliyun.oss.internal.OSSUtils.<clinit>(OSSUtils.java:54) ... 38 more

用的
<dependency> <groupId>com.aliyun.oss</groupId> <artifactId>aliyun-sdk-oss</artifactId> </dependency>
version : 2.2.3

Error while provisioning the ECS instance

Hi,

I am using aliyun-java-sdk-core - 4.0.2 and aliyun-java-sdk-ecs - 4.9.1 jar dependencies to access the Alibaba cloud through my java program. Whenever I use - DescribeInstancesRequest to fetch instance details it works fine. But when I use - CreateInstanceRequest for provisioning the instance I'm getting the following error

This operation is forbidden by Aliyun RiskControl system.
com.aliyuncs.exceptions.ClientException: Forbidden.RiskControl : This operation is forbidden by Aliyun RiskControl system.
RequestId : D6F41D2C-E4C8-4D92-8CF3-50F35B9E2134

I'm passing following information as part the CreateInstanceRequest.
request.setInstanceType("ecs.c5.large");
request.setSecurityGroupId("sg-t4ni0t9v2ixxf5gzd0o1");
request.setInstanceName("xx-ubuntu");
request.setImageId("ubuntu_16_0402_64_20G_alibase_20180409.vhd");
request.setClientToken(UUID.randomUUID().toString());

topic权限控制有问题

给只有订阅权限的topic发布消息依然可以成功,而且另一端确实可以成功订阅消息

cms 参数设置无效。

public class CreateMetricsRequest extends RpcAcsRequest {

public CreateMetricsRequest() {
    super("Cms", "2015-08-01", "CreateMetrics");
    setMethod(MethodType.POST);
}

private String projectName;

private String metricStreamName;

private String metrics;

public String getProjectName() {
    return this.projectName;
}

public void setProjectName(String projectName) {
    this.projectName = projectName;
    putQueryParameter("ProjectName", projectName);
}

public String getMetricStreamName() {
    return this.metricStreamName;
}

public void setMetricStreamName(String metricStreamName) {
    this.metricStreamName = metricStreamName;
    putQueryParameter("MetricStreamName", metricStreamName);
}

public String getMetrics() {
    return this.metrics;
}

public void setMetrics(String metrics) {
    this.metrics = metrics;
    }

@Override
public Class<CreateMetricsResponse> getResponseClass() {
    return CreateMetricsResponse.class;
}

}

metrics这个参数设置无效啊?

Latest version has vulnerable dependency

According to SourceClear, https://www.sourceclear.com/vulnerability-database/libraries/230, Jackson-databind is vulnerable. Can we use another library?

Jackson-databind is vulnerable to remote code execution (RCE) attacks. Attackers can exploit an incomplete fix of `CVE-2017-7525` to bypass the blacklist when Spring libraries are available on the class path. In order to be vulnerable to this attack, either the use of `@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)` or `@JsonTypeInfo(use = JsonTypeInfo.Id.MINIMAL_CLASS)` or a call to `ObjectMapper.enableDefaultTyping(...)` is needed.

ESS接口调用返回错误

{
"Message": "Specified parameter Version is not valid.",
"RequestId": "948256E2-4AFC-423B-BC4C-A367E37582FD",
"HostId": "ecs.aliyuncs.com",
"Code": "InvalidVersion"
}

The filename or extension is too long.

go build github.com/aliyun/alibaba-cloud-sdk-go/services/ecs: G:\go\pkg\tool\windows_amd64\compile.exe: fork/exec G:\go\pkg\tool\windows_amd64\compile.exe: The filename or extension is too long.

如何解决?

License header wrong in all the sources

Hello,

As far as I know this SDK has not been formally donated to the Apache Software Foundation.

All the license header are wrong as they mention:

 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at

If you look at http://www.apache.org/licenses/LICENSE-2.0#apply the format you should be using is

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

where the copyright holder, I assume, is Alibaba.

If you need any more info you can ask on the Apache mailing lists (like legal-discuss@ ).

Cdn SDK接入报错

com.aliyuncs.exceptions.ClientException: SDK.InvalidRegionId : Can not find endpoint to access.
at com.aliyuncs.DefaultAcsClient.doAction(DefaultAcsClient.java:159)
at com.aliyuncs.DefaultAcsClient.doAction(DefaultAcsClient.java:123)
at com.aliyuncs.DefaultAcsClient.doAction(DefaultAcsClient.java:57)

自己使用的阿里云sdk核心包2.1.7 阿里云cdn sdk包版本为2.5.0 发现没有包含有 product name (Cdn) 建议完善响应sdk依赖阿里云核心包最低版本(希望有文档给说明下)

IoT 发布广播消息的疑惑

我现在在IoT控制台创建了一个产品,假设productKey为252FUPqSxj2vXXX,该产品下有一个设备(deviceName为test_device)订阅了Topic:/252FUPqSxj2vXXX/test_device/get;我现在调用发布广播消息接口,并设置TopicFullName参数为:/broadcast/252FUPqSxj2vXXX/get,但设备并没有收到订阅消息。应该是我用法错了,能再解释一下这个接口么?

maven 无法下载 aliyun-java-sdk-core 4.0.6 以上版本

<=4.0.6:

image

image

> 4.0.6

image

image

仓库配置:

<repositories> 
  <repository> 
    <id>alimaven</id>  
    <name>aliyun maven</name>  
    <url>https://maven.aliyun.com/repository/public</url>  
    <releases> 
      <enabled>true</enabled> 
    </releases>  
    <snapshots> 
      <enabled>false</enabled> 
    </snapshots> 
  </repository> 
</repositories>

是我的配置有问题吗?

InvalidDiskCategory.ZoneNotSupported

I'm seeing the following error. My code was working all of a sudden it started throwing this errors.
BTW - Niether SystemDisk nor DataDisk are set.

com.aliyuncs.exceptions.ClientException: InvalidDiskCategory.ZoneNotSupported : The specified zone does not support this disk category

RDS backups size greater than Integer.MAX_VALUE will fail

If my RDS backup size is greater than Integer.MAX_VALUE (2147483647) it fails because the library uses a integer to hold the size of the backup.

public class DescribeBackupsResponse extends AcsResponse {
31	
32		private String requestId;
33	
34		private String totalRecordCount;
…	
76		public Integer getTotalBackupSize() {
77			return this.totalBackupSize;
78		}
Caused by: java.lang.NumberFormatException: For input string: "14238202880"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:583)
	at java.lang.Integer.valueOf(Integer.java:766)
	at com.aliyuncs.transform.UnmarshallerContext.integerValue(UnmarshallerContext.java:37)
	at com.aliyuncs.rds.transform.v20140815.DescribeBackupsResponseUnmarshaller.unmarshall(DescribeBackupsResponseUnmarshaller.java:43)
	at com.aliyuncs.rds.model.v20140815.DescribeBackupsResponse.getInstance(DescribeBackupsResponse.java:467)
	at com.aliyuncs.rds.model.v20140815.DescribeBackupsResponse.getInstance(DescribeBackupsResponse.java:30)
	at com.aliyuncs.DefaultAcsClient.readResponse(DefaultAcsClient.java:220)
	at com.aliyuncs.DefaultAcsClient.parseAcsResponse(DefaultAcsClient.java:160)
	at com.aliyuncs.DefaultAcsClient.getAcsResponse(DefaultAcsClient.java:104)

SDK核心库 设置连接时发生 java.lang.NoSuchMethodError: com.google.gson.JsonObject.keySet()Ljava/util/Set;

最新版本的SDK

com.aliyun
aliyun-java-sdk-core
4.1.2

走到这一步(IAcsClient client = new DefaultAcsClient(profile);)的时候报下面的错误

Exception in thread "main" java.lang.NoSuchMethodError: com.google.gson.JsonObject.keySet()Ljava/util/Set;
at com.aliyuncs.endpoint.LocalConfigRegionalEndpointResolver.initRegionalEndpointData(LocalConfigRegionalEndpointResolver.java:64)
at com.aliyuncs.endpoint.LocalConfigRegionalEndpointResolver.initLocalConfig(LocalConfigRegionalEndpointResolver.java:53)
at com.aliyuncs.endpoint.LocalConfigRegionalEndpointResolver.(LocalConfigRegionalEndpointResolver.java:43)
at com.aliyuncs.endpoint.DefaultEndpointResolver.(DefaultEndpointResolver.java:42)
at com.aliyuncs.endpoint.DefaultEndpointResolver.(DefaultEndpointResolver.java:54)
at com.aliyuncs.DefaultAcsClient.(DefaultAcsClient.java:81)
at com.aliyuncs.DefaultAcsClient.(DefaultAcsClient.java:69)

android里没用javax.xml.bind.DatatypeConverter

因为这个HmacSHA1Signer.java导入了javax.xml.bind.DatatypeConverter.
所以没法在android中使用,实在是不知道怎么弄了.
应该是android库中没有一些可以用的库吧,希望可以改下调用啥的,兼容下android( ゚ 3゚)
我想弄个一键新建ecs服务器的应用来方便我挂代理玩游戏,按量计费每次手动配置太麻烦了.

KeyPairCredentials (AK 2.0) won't work if my region is non-Japan region?

Below is my code, where AkBaseBuilder will build the Client request using the below constructor:

// clientBuilder = new AkBaseBuilder("us-west-1"); <-- Doesn't work, throw com.aliyuncs.exceptions.ServerException: InternalError
clientBuilder = new AkBaseBuilder("ap-northeast-1"); <-- This works

AkBaseBuilder.java

/** ClientBuilder: an interface to help build an IAcsClient, make it compatible with old way of using key/secret. */
public class AkBaseBuilder implements ClientBuilder {

  private final IClientProfile profile;
  private final KeyPairCredentials credentials;

  public AkBaseBuilder(String regionId) throws IOException {
    InputStream privateKey =
        AkBaseBuilder.class.getClassLoader().getResourceAsStream("private_key.pem");
    this.profile = DefaultProfile.getProfile(regionId);
    this.credentials = new KeyPairCredentials("<myPublicKeyId>", read(privateKey));
  }

  private static String read(InputStream input) throws IOException {
    try (BufferedReader buffer = new BufferedReader(new InputStreamReader(input))) {
      return buffer.lines().collect(Collectors.joining("\n"));
    }
  }

  @Override public IAcsClient build() {
    STSGetSessionAccessKeyCredentialsProvider credentialsProvider =
        new STSGetSessionAccessKeyCredentialsProvider(credentials, profile);
    return new DefaultAcsClient(profile, credentialsProvider);
  }
}

I want to have my client to flexibly switch between Japan and US for scalability. Also using AK2.0 is super useful, but it seems that the client always failed to make the request to non-Japan region (like US as above). Please help to tell if I'm doing anything wrong or how it can be fixed?

I'm using sdk-core 3.5.1, java 8 sdk. Thanks in advance.

发送邮件的regionId 填什么?

IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKey, accessSecret);
填杭州可以发送成功,就是后台总有提示错误。也不说明下参数调用?

Invoke_Error, requestId:9D03AE06-25BD-449C-A0AD-5993EB556ABE; code:InvalidRegionId; MsgThe specified region does not exist.
2016-08-18 17:51:52.789 INFO 30736 --- [cTaskExecutor-1] mail sent to [email protected] with envId: 77924358388

有高防相关的文档吗?

用了aliyun-java-sdk-ddospro,先是报SDK.InvalidRegionId Can not find endpoint to access.,然后通过看源码发现是要手动添加productDomain
然后添加了ProductDomain productDomain = new ProductDomain("HighDDos", "yd-highddos-cn-hangzhou.aliyuncs.com");
又报 InvalidAction.NotFound : Specified api is not found, please check your url and method.

能不能提供一下文档? 这样用着真心不是像你们文档上说的这样。
image

Question on DefaultAcsClient region and real resource region

Hi, I used to initialize a DefaultAcsClient with a default regionId in the profile, and I could use this Client to create resources (e.g VPC instances) in other regions. However, I failed to do that since early Nov. It will give me error "Can not find endpoint to access" if I try to create a resource in other region than the region for the DefaultAcsClient.
Is there any change related to this issue?

Thanks!

ecs api查询快照pageSize 大于50返回结果 为空

sdk用的是
aliyun-sdk-java-online_standard-20141010.jar

查询快照的时候,文档上说 pageSize 0-100
文档地址 (请新窗口打开)
实际 我传值大于50 返回结果就为空.

package app.bug.ali.sdk;

import java.util.List;

import org.apache.log4j.Logger;

import com.aliyun.api.AliyunClient;
import com.aliyun.api.DefaultAliyunClient;
import com.aliyun.api.domain.Snapshot;
import com.aliyun.api.ecs.ecs20140526.request.DescribeSnapshotsRequest;
import com.aliyun.api.ecs.ecs20140526.response.DescribeSnapshotsResponse;

public class BugReport {
    private final static String tom = null;//"换成你的Key"
    private final static String jerry =  null;//"换成你的Key"
    private static final Logger logger = Logger.getLogger(BugReport.class);
    /**
     * region id : cn-beijing
     */
    private static final String REGIONID = "cn-beijing";
    private static AliyunClient client = new DefaultAliyunClient("http://ecs.aliyuncs.com", jerry, tom);

    public void pageSizeShow(long pageSize) {
        DescribeSnapshotsRequest request = new DescribeSnapshotsRequest();
        request.setRegionId(REGIONID);
        request.setPageNumber(1l);
        request.setPageSize(pageSize);
        try {
            DescribeSnapshotsResponse response = client.execute(request);
            logger.info(response.getBody());
            logger.info("ErrorCode:" + response.getErrorCode());
            List<Snapshot> datas = response.getSnapshots();
            int i = 1;
            for (Snapshot data : datas) {
                logger.info("Data:" + i + data.getSnapshotName());
                i++;
            }
        } catch (Exception e) {
            logger.error("PageSize:" + pageSize + "  --" + e);
        }
    }

    public static void main(String[] args) {
        new BugReport().pageSizeShow(50l);
        new BugReport().pageSizeShow(60l);
        new BugReport().pageSizeShow(99l);
    }
}


运行结果后几条:

09:52:39.639 [main] ERROR app.bug.ali.sdk.BugReport - PageSize:60  --java.lang.NullPointerException
09:52:39.639 [main] ERROR app.bug.ali.sdk.BugReport - PageSize:99  --java.lang.NullPointerException

获取slb 的Metric数据

在获取slb的监控数据时,{instanceId:'"+instanceId+"'}设置slb的id,但是获取不到数据。ECS可以获取到。

版本依赖问题

请问 aliyun-java-sdk-core 3.* 是向下兼容 aliyun-java-sdk-core 2.* 的吗?

我们公司某个项目同时使用了短信功能和邮件功能,但是短信和邮件 SDK 分别依赖于 aliyun-java-sdk-core 3.* 2.* 两个不同的大版本。。。

如何获取所有区域的信息

创建IClientProfile profile对象的时候只能DefaultProfile.getProfile方法获取,但是需要传入一个regionId。当我是查询所有区域的时候,这个regionId传递什么值呢?

云市场按量数据推送接口持续返回 500 错误

按照按量数据推送接口的样例,尝试推送数据之后,会持续返回 500 错误,其中 instanceId 是真实的 ID。

请教一下,导致这个错误的原因有哪些呢?

另外,我看到样例里面 endpointregionId 都是 cn-hangzhou1,想请教一下这两个的定义是什么,有没有可取指的列表?

RDS DescribeBackupResponse中的Bug

Response中是用Integer来存储back size的,当备份量过大时会抛异常
java.lang.NumberFormatException: For input string: "17882173440" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:495) at java.lang.Integer.valueOf(Integer.java:582) at com.aliyuncs.transform.UnmarshallerContext.integerValue(UnmarshallerContext.java:37) at com.aliyuncs.rds.transform.v20140815.DescribeBackupsResponseUnmarshaller.unmarshall(DescribeBackupsResponseUnmarshaller.java:47) at com.aliyuncs.rds.model.v20140815.DescribeBackupsResponse.getInstance(DescribeBackupsResponse.java:468) at com.aliyuncs.rds.model.v20140815.DescribeBackupsResponse.getInstance(DescribeBackupsResponse.java:30) at com.aliyuncs.DefaultAcsClient.readResponse(DefaultAcsClient.java:192) at com.aliyuncs.DefaultAcsClient.parseAcsResponse(DefaultAcsClient.java:132) at com.aliyuncs.DefaultAcsClient.getAcsResponse(DefaultAcsClient.java:89) at com.aihuishou.aliyun.Boot$.getDBLatestBackupTime(Boot.scala:82) at com.aihuishou.aliyun.Boot$.main(Boot.scala:30) at com.aihuishou.aliyun.Boot.main(Boot.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at sbt.Run.invokeMain(Run.scala:67) at sbt.Run.run0(Run.scala:61) at sbt.Run.sbt$Run$$execute$1(Run.scala:51) at sbt.Run$$anonfun$run$1.apply$mcV$sp(Run.scala:55) at sbt.Run$$anonfun$run$1.apply(Run.scala:55) at sbt.Run$$anonfun$run$1.apply(Run.scala:55) at sbt.Logger$$anon$4.apply(Logger.scala:85) at sbt.TrapExit$App.run(TrapExit.scala:248) at java.lang.Thread.run(Thread.java:745)

DescribeLoadBalancerTCPListenerAttributeRequest 中存在bug

com.aliyuncs.slb.model.v20140515.DescribeLoadBalancerTCPListenerAttributeRequest.putQueryParameter(Ljava/lang/String;Ljava/lang/Object;)V] with root cause java.lang.NoSuchMethodError: com.aliyuncs.slb.model.v20140515.DescribeLoadBalancerTCPListenerAttributeRequest.putQueryParameter(Ljava/lang/String;Ljava/lang/Object;)V at com.aliyuncs.slb.model.v20140515.DescribeLoadBalancerTCPListenerAttributeRequest.setListenerPort(DescribeLoadBalancerTCPListenerAttributeRequest.java:91) ~[aliyun-java-sdk-slb-2.1.jar:na]

DescribeLoadBalancerTCPListenerAttributeRequest 源码里面
public void setListenerPort(Integer listenerPort) { this.listenerPort = listenerPort; this.putQueryParameter("ListenerPort", listenerPort); }
设置的参数为Integer,然而 this.putQueryParameter 方法实际上是 String 。

Android使用邮件服务出现SignatureDoesNotMatch

public void sample() {
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", "****手动打码", "****手动打码");
IAcsClient client = new DefaultAcsClient(profile);
SingleSendMailRequest request = new SingleSendMailRequest();
try {
//request.setVersion("2017-06-22");// 如果是除杭州region外的其它region(如新加坡region),必须指定为2017-06-22
request.setAccountName("***手动打码");
request.setFromAlias("同学");
request.setAddressType(1);
request.setTagName("邮箱验证");
request.setReplyToAddress(true);
request.setToAddress("**手动打码");
//可以给多个收件人发送邮件,收件人之间用逗号分开,批量发信建议使用BatchSendMailRequest方式
//request.setToAddress("邮箱1,邮箱2");
request.setSubject("邮件主题[登录验证]");
request.setHtmlBody("用户您好:
验证码为:<span style="font-size: 24px; color: #4caf50;">470365,该验证码15分钟内有效,请勿将验证码泄露于他人。");
SingleSendMailResponse httpResponse = client.getAcsResponse(request);
} catch (ServerException e) {
e.printStackTrace();
emitter.onError(e);
} catch (ClientException e) {
e.printStackTrace();
}
}
}

在IntelliJ Idea上可以发送成功,但是在AndroidStudio上运行就报错:SignatureDoesNotMatch。这是为什么?
都是gradle依赖:
repositories {
...
maven{url "https://mvnrepository.com/artifact/com.aliyun/aliyun-java-sdk-core"}
maven{url "https://mvnrepository.com/artifact/com.aliyun/aliyun-java-sdk-dm"}
}

dependencies {
implementation 'com.aliyun:aliyun-java-sdk-core:3.0.0'
implementation 'com.aliyun:aliyun-java-sdk-dm:3.1.0'
}

charles抓包看的时候,IntelliJ Idea为get请求,Android上的请求却是POST!!!

SDK的使用

SDK代码做的很好,但能不能提供个文档告诉我们每个SDK项目对应的产品是什么

好多产品的缩写也只能是你们内部人员知道的,我们用户怎么知道那缩写是什么意思

获取emr集群信息报错 SDK.InvalidRegionId : Can not find endpoint to access

获取emr集群信息报错 SDK.InvalidRegionId : Can not find endpoint to access

我的regionid应该是没有问题的,
accesskeyid和accesskeysecret在日志服务里面都可以使用,所以感觉这边应该也没有问题

但是获取emr集群信息的时候回报错误
com.aliyuncs.exceptions.ClientException: SDK.InvalidRegionId : Can not find endpoint to access.
at com.aliyuncs.DefaultAcsClient.doAction(DefaultAcsClient.java:261)
at com.aliyuncs.DefaultAcsClient.doAction(DefaultAcsClient.java:207)
at com.aliyuncs.DefaultAcsClient.doAction(DefaultAcsClient.java:100)
at com.aliyuncs.DefaultAcsClient.getAcsResponse(DefaultAcsClient.java:144)
at com.vip.bigdata.util.emr.EmrUtils$.getClusterInfo(EmrUtils.scala:80)
... 48 elided

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.