minio上传文件,报方法不存在错误

Blade 已结 1 588
jse7en
jse7en 2022-02-23 14:58
悬赏:5

一、该问题的重现步骤是什么?

    引入依赖。image.png

  1.   配置文件配置相关属性。image.png

2. 创建接口。image.png

3. postman测试接口,运行到makeBucet方法中,抛出异常。image.png


二、你期待的结果是什么?实际看到的又是什么?

期待结果:文件上传成功,从接口返回上拿到链接。实际上看到报错提示:bucketExists方法不存在。

三、你正在使用的是什么产品,什么版本?在什么操作系统上?

SpringBoot2.8.1.RELEASE,linux操作系统。

四、请提供详细的错误堆栈信息,这很重要。

Caused by: java.lang.NoSuchMethodError: io.minio.MinioClient.bucketExists(Ljava/lang/String;)Z

at org.springblade.core.oss.minio.MinioTemplate.makeBucket(MinioTemplate.java:65)

at org.springblade.core.oss.minio.MinioTemplate.putFile(MinioTemplate.java:185)

at org.springblade.core.oss.minio.MinioTemplate.putFile(MinioTemplate.java:180)

at com.gzsc_tech.system.controller.MinioController.put(MinioController.java:32)

at com.gzsc_tech.system.controller.MinioController$$FastClassBySpringCGLIB$$8197a458.invoke()

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)

at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)

at org.springblade.core.log.aspect.RequestLogAspect.aroundApi(RequestLogAspect.java:112)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)

at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)

at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)

at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)

at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)

at com.gzsc_tech.system.controller.MinioController$$EnhancerBySpringCGLIB$$aa3aa924.put()

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)

at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)

at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792)

at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)

... 62 common frames omitted

五、若有更多详细信息,请在下面提供。

1条回答
  •  admin
    admin (楼主)
    2022-02-24 10:55

    你的bladex是2.7.x版本,对应api的minio版本也会较低所以之前的方法没有了,你降低几个大版本安装minio再试试。

    0 讨论(1)
提交回复