【发布时间】:2020-05-28 19:01:11
【问题描述】:
我使用 GCP Vision API 几乎过去 3 年,直到它正常工作前几天。 但是从最近几天开始,我开始出现以下错误。
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
不知道为什么会失败。需要帮助来解决它。拥有有效的计费帐户和 OAuth 凭据 json。
AnnotateImageRequest request = new AnnotateImageRequest()
.setImage(new Image().encodeContent(image))
.setFeatures(ImmutableList.of(new Feature().setType("LOGO_DETECTION").setMaxResults(MAX_RESULTS),
new Feature().setType("IMAGE_PROPERTIES").setMaxResults(MAX_RESULTS),
new Feature().setType("TEXT_DETECTION").setMaxResults(MAX_RESULTS)));
Vision.Images.Annotate annotate = vision.images()
.annotate(new BatchAnnotateImagesRequest().setRequests(ImmutableList.of(request)));
BatchAnnotateImagesResponse batchResponse = annotate.execute();
在最后一行出现上述错误。
【问题讨论】:
-
我想你的问题在这里得到了回答stackoverflow.com/questions/21076179/…
-
GCP Vision API 提供 JSON 格式的 OAuth 文件,我在创建 Vision 对象时手动加载了该文件。我没有任何证书文件。
标签: google-cloud-platform google-cloud-vision