You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

服务器端GoogleCredentials初始化异常求助:本地正常服务器无响应

GoogleCredentials.fromStream在服务器端卡住无响应,本地运行正常

问题概述

本地机器上GoogleCredentials相关代码可正常执行,但部署到服务器后,代码卡在GoogleCredentials.fromStream()步骤,既不返回结果也不抛出异常,无法获取凭据对象。

代码片段

InputStream credentialsStream = createJsonFile(keyFileStream);
GoogleCredentials credentials = GoogleCredentials.fromStream(credentialsStream)
    .createScoped(
        Collections.singletonList("https://www.googleapis.com/auth/devstorage.full_control")
    );

问题细节

  • 本地环境:代码运行正常,已验证凭据文件、API权限范围配置均正确
  • 服务器环境:执行到以下代码时卡住,无任何错误输出
    GoogleCredentials credentials = GoogleCredentials.fromStream(credentialsStream);
    
  • 期望:代码在本地和服务器端表现一致,能正常获取GoogleCredentials对象

内容的提问来源于stack exchange,提问作者devmanish

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 18:07:02