Skip to content

[Question] throw a error #51

Description

@yxh-flow

image
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aliCloudEdasSdk' defined in class path resource [com/alibaba/cloud/spring/boot/context/autoconfigure/EdasContextAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.alibaba.cloud.context.edas.AliCloudEdasSdk]: Factory method 'aliCloudEdasSdk' threw exception; nested exception is java.lang.NoSuchMethodError: com.aliyuncs.profile.DefaultProfile.getHttpClientConfig()Lcom/aliyuncs/http/HttpClientConfig;

my code:

@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = {ThirdPartyApplication.class}, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class ThirdPartyApplicationTests {

@Autowired
private OSS ossClient;


@Test
public void  testUpdload(){

    String bucketName = "yangxiaohui";

    String objectName = "product/b.json";

    String content = "{name:yangxiaohui}";
    ossClient.putObject(bucketName, objectName, new ByteArrayInputStream(content.getBytes()));
    ossClient.shutdown();
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions