[英]Calling getRegionName() on a awsS3Client backed by minio throws IllegalStateException
Calling getRegionName() on a awsS3Client backed by minio throws IllegalStateException.在 minio 支持的 awsS3Client 上调用 getRegionName() 会引发 IllegalStateException。
The Minio configuration does include a region name. Minio 配置确实包含区域名称。 So, it is wierd that getRegionName() fails.因此,getRegionName() 失败是很奇怪的。 That too, it throws IllegalStateException.同样,它也会抛出 IllegalStateException。
"java.lang.IllegalStateException: No valid region has been specified. Unable to return region name" “java.lang.IllegalStateException:未指定有效区域。无法返回区域名称”
What's going wrong?怎么了?
It doesn't matter whether a region is configured in minio configuration.区域是否在 minio 配置中配置无关紧要。
The problem is because the awsS3Client.getRegionName() checks to make sure that the host name conforms to a AWS domain name regex.问题是因为 awsS3Client.getRegionName() 检查以确保主机名符合 AWS 域名正则表达式。 If the host name doesn't conform to that pattern, it throws an IllegalStateException.如果主机名不符合该模式,则会引发 IllegalStateException。
So, if there is a s3Client.getRegionName() call which you want to work even in Local / Development environments, replace it with just getting the region from your config like appS3Config.getRegion()因此,如果有一个 s3Client.getRegionName() 调用,即使在本地/开发环境中您也想工作,请将其替换为仅从您的配置中获取区域,例如 appS3Config.getRegion()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.