alibabacloud-java-async-sdk icon indicating copy to clipboard operation
alibabacloud-java-async-sdk copied to clipboard

发送短信报错

Open shaobohan917 opened this issue 2 years ago • 2 comments

`// Asynchronously get the return value of the API request

CompletableFuture<SendSmsResponse> response = client.sendSms(sendSmsRequest);

// Synchronously get the return value of the API request

SendSmsResponse resp = response.get();`

执行到resonse.get()时,报错: java.lang.NoClassDefFoundError: org/apache/hc/client5/http/async/methods/SimpleRequestBuilder

shaobohan917 avatar Aug 07 '23 08:08 shaobohan917

我也遇到了。jdk8,springboot2.5.8

YMingPro avatar Apr 09 '24 13:04 YMingPro

org/apache/hc/client5/http/async/methods/SimpleRequestBuilder

最终重新统一apache的包得以解决

<dependency>
            <groupId>org.apache.httpcomponents.client5</groupId>
            <artifactId>httpclient5</artifactId>
            <version>5.1.2</version> <!-- 替换为你所需的版本 -->
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents.core5</groupId>
            <artifactId>httpcore5-h2</artifactId>
            <version>5.1.2</version> <!-- 替换为你所需的版本 -->
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents.core5</groupId>
            <artifactId>httpcore5</artifactId>
            <version>5.1.2</version> <!-- 替换为你所需的版本 -->
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents.core5</groupId>
            <artifactId>httpcore5-reactive</artifactId>
            <version>5.1.2</version> <!-- 替换为你所需的版本 -->
        </dependency>

YMingPro avatar Apr 09 '24 14:04 YMingPro