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

solon 下使用 minio 报错 #297

Open
transtone opened this issue Sep 19, 2024 · 5 comments
Open

solon 下使用 minio 报错 #297

transtone opened this issue Sep 19, 2024 · 5 comments

Comments

@transtone
Copy link

transtone commented Sep 19, 2024

按照文档配置了 solon 环境,但在上传文件的时候报错。

solon-2.9.3

	at org.noear.solon.SolonApp.tryHandle(SolonApp.java:467)
	at org.noear.solon.boot.smarthttp.http.SmHttpContextHandler.handleDo(SmHttpContextHandler.java:125)
	at org.noear.solon.boot.smarthttp.http.SmHttpContextHandler.handle0(SmHttpContextHandler.java:103)
	at org.noear.solon.boot.smarthttp.http.SmHttpContextHandler.lambda$handle$0(SmHttpContextHandler.java:88)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:775)

Caused by: java.lang.invoke.LambdaConversionException:
 Invalid receiver type class org.noear.solon.core.handle.UploadedFile; 
not a subtype of implementation receiver type class org.noear.solon.core.handle.DownloadedFile

	at java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambdaMetafactory.java:240)
	at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:303)
	at java.lang.invoke.CallSite.makeSite(CallSite.java:302)
	... 52 more

{
  "code": 500,
  "msg": "服务端运行出错",
  "result": "call site initialization exception"
}

用 minioClient 测试了地址和 bucket,是正常可以访问的。

测试项目地址:https://gitee.com/gridsoft/x-file-storage-solon-test

@transtone transtone changed the title solon 下使用 minio solon 下使用 minio 报错 Sep 19, 2024
@noear
Copy link

noear commented Sep 20, 2024

找到原因了。 2.8.5 时,把 UploadedFile 的基类,改成了 FileBase 。。。我请作者升级 solon 到 2.8.6

@noear
Copy link

noear commented Sep 20, 2024

谢谢你的反馈!

@1171736840
Copy link
Collaborator

目前可以参考 文件适配器 对 UploadedFile 手动适配一下就可以了

@noear
Copy link

noear commented Sep 20, 2024

就是用 FileWrapper 包装,替代下它。

@transtone
Copy link
Author

transtone commented Sep 20, 2024

目前可以参考 文件适配器 对 UploadedFile 手动适配一下就可以了

多谢回复。

本地编译了一个升级了依赖的版本 2.2.1-1,放到了 ~/.m2/ 下。机智如我~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants