启动报错 OSS

提问 未结 7 100
吴亦凡
吴亦凡 2020-11-19
悬赏:20积分
版本:renren-fast 最新 开发环境:IDEA
[pre] Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2020-11-19 16:37:22.189 INFO 24848 --- [ main] c.a.alicloud.oss.OssApplicationListener : 0 OSSClients will be shutdown soon 2020-11-19 16:37:22.196 ERROR 24848 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ossClient' defined in class path resource [com/alibaba/alicloud/context/oss/OssContextAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.aliyun.oss.OSS]: Factory method 'ossClient' threw exception; nested exception is java.lang.IllegalArgumentException: Oss endpoint can't be empty. at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:656) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:636) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.4.RELEASE.jar:2.2.4.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.2.4.RELEASE.jar:2.2.4.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.2.4.RELEASE.jar:2.2.4.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.2.4.RELEASE.jar:2.2.4.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.4.RELEASE.jar:2.2.4.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.4.RELEASE.jar:2.2.4.RELEASE] at io.renren.RenrenApplication.main(RenrenApplication.java:21) ~[classes/:na] Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.aliyun.oss.OSS]: Factory method 'ossClient' threw exception; nested exception is java.lang.IllegalArgumentException: Oss endpoint can't be empty. at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] ... 19 common frames omitted Caused by: java.lang.IllegalArgumentException: Oss endpoint can't be empty. at org.springframework.util.Assert.isTrue(Assert.java:118) ~[spring-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at com.alibaba.alicloud.context.oss.OssContextAutoConfiguration.ossClient(OssContextAutoConfiguration.java:54) ~[spring-cloud-alicloud-context-2.1.0.RELEASE.jar:2.1.0.RELEASE] at com.alibaba.alicloud.context.oss.OssContextAutoConfiguration$$EnhancerBySpringCGLIB$$118ab96d.CGLIB$ossClient$0(<generated>) ~[spring-cloud-alicloud-context-2.1.0.RELEASE.jar:2.1.0.RELEASE] at com.alibaba.alicloud.context.oss.OssContextAutoConfiguration$$EnhancerBySpringCGLIB$$118ab96d$$FastClassBySpringCGLIB$$a528d6d6.invoke(<generated>) ~[spring-cloud-alicloud-context-2.1.0.RELEASE.jar:2.1.0.RELEASE] at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) ~[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE] at com.alibaba.alicloud.context.oss.OssContextAutoConfiguration$$EnhancerBySpringCGLIB$$118ab96d.ossClient(<generated>) ~[spring-cloud-alicloud-context-2.1.0.RELEASE.jar:2.1.0.RELEASE] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE] ... 20 common frames omitted Process finished with exit code 1 [/pre]
回帖
  • 报错信息很明显,阿里云的endpoint不能为空
    0 回复
  • 吴亦凡
    吴亦凡 (楼主)
    2020-11-19
    @Mark 没有看到哪里配置啊
    0 回复
  • @吴亦凡 文件上传界面可以配置
    0 回复
  • 吴亦凡
    吴亦凡 (楼主)
    2020-11-19
    @Mark 都启动不了啊,开始不报错,我重启一下就报错了
    0 回复
  • 吴亦凡
    吴亦凡 (楼主)
    2020-11-19
    @Mark 在哪创建Bean 我也没找到
    0 回复
  • @吴亦凡 检查一下自己写的代码,是不是有问题,实在不行,就把代码还原一下啊 face[挖鼻]
    0 回复
  • 吴亦凡
    吴亦凡 (楼主)
    2020-11-19
    @Mark ok了 依赖的问题
    0 回复