Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform GCP:Vision API:获取认证错误_Google Cloud Platform_Google Cloud Vision - Fatal编程技术网

Google cloud platform GCP:Vision API:获取认证错误

Google cloud platform GCP:Vision API:获取认证错误,google-cloud-platform,google-cloud-vision,Google Cloud Platform,Google Cloud Vision,我使用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 不知

我使用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凭据

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();

在最后一行中获取上述错误。

该错误与SSL有关。这意味着Java试图打开SSL连接,但无法找到验证Google服务器证书的证书链。这不是特定于云视觉的问题

谷歌为谷歌网站和服务管理自己的证书颁发机构。您需要信任才能访问Google服务的必要根证书可以从中检索

您能确保所有这些根证书都安装在您的证书信任库中吗

如果您以与调用Cloud Vision API相同的方式调用其他Google API,是否会出现此问题

您的设备是否位于任何可能干扰建立SSL连接的代理或防火墙之后?是否有任何个人防火墙、网络设备或软件可能会阻止此流量?特别是,必须为SSL加密流量启用端口443

你能在其他设备上重现这个问题吗?或者在连接到不同网络的设备上

请求计算机上的系统时钟设置是否正确?如果时钟关闭,计算机可能会错误地认为证书已过期或无效

您能否使用Google API Explorer验证Cloud Vision API是否适用于您所在域的成员?
例如,在您的域中,任何使用Cloud Vision的人都应该能够遵循此链接,并测试API

我想你的问题在这里得到了回答。这回答了你的问题吗?GCP Vision API提供JSON格式的OAuth文件,我在创建Vision对象时手动加载了该文件。我没有任何证书文件。