Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] throw a error #51

Open
yxh-flow opened this issue Jan 8, 2021 · 4 comments
Open

[Question] throw a error #51

yxh-flow opened this issue Jan 8, 2021 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@yxh-flow
Copy link

yxh-flow commented Jan 8, 2021

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();
}

}

@yxh-flow yxh-flow added the help wanted Extra attention is needed label Jan 8, 2021
@yxh-flow
Copy link
Author

yxh-flow commented Jan 8, 2021

maven :
dependency>
com.alibaba.cloud
aliyun-oss-spring-boot-starter
1.0.0

and I have configured the relevant properties in my application.yml ;such as access-key,secret-key,endpoint

@ppzzyy11
Copy link
Collaborator

Can you upload your project to a github repository so I can help you figure out conflicts.

@Sunnypain
Copy link

you can import another dependency which like this to solve your problem:

com.aliyun
aliyun-java-sdk-core
4.5.0

@Surrin1999
Copy link

you can import another dependency which like this to solve your problem: com.aliyun aliyun-java-sdk-core 4.5.0

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants