2017-07-28 68 views
0

因爲我已經在我的電腦安裝了谷歌雲控制檯應用程序在本地,我得到這個錯誤任何時候我的Java服務器撥打電話到谷歌翻譯:谷歌雲translaet - 認證證書是來自不同項目的

Exception in thread "Thread-22" com.google.cloud.translate.TranslateException: 400 Bad Request 
{ 
    "error": { 
    "code": 400, 
    "message": "The API Key and the authentication credential are from different projects.", 
    "errors": [ 
     { 
     "message": "The API Key and the authentication credential are from different projects.", 
     "domain": "global", 
     "reason": "badRequest" 
     } 
    ], 
    "status": "INVALID_ARGUMENT" 
    } 
} 

    at com.google.cloud.translate.spi.v2.HttpTranslateRpc.translate(HttpTranslateRpc.java:61) 
    at com.google.cloud.translate.spi.v2.HttpTranslateRpc.detect(HttpTranslateRpc.java:87) 
    at com.google.cloud.translate.TranslateImpl$3.call(TranslateImpl.java:79) 
    at com.google.cloud.translate.TranslateImpl$3.call(TranslateImpl.java:76) 
    at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:93) 
    at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:49) 
    at com.google.cloud.translate.TranslateImpl.detect(TranslateImpl.java:76) 
    at com.google.cloud.translate.TranslateImpl.detect(TranslateImpl.java:104) 
    at com.exceed.providers.googleapi.GoogleTranslateConnector.detectLanguage(GoogleTranslateConnector.java:49) 
    at com.exceed.providers.googleapi.GoogleTranslateConnector.detectLanguageWithConfidence(GoogleTranslateConnector.java:53) 
    at com.exceed.services.ConversationManagerService.handleUnknownLanguage(ConversationManagerService.java:369) 
    at com.exceed.services.ConversationManagerService.processMessage(ConversationManagerService.java:227) 
    at com.exceed.services.FBWebHookService.processMessage(FBWebHookService.java:210) 
    at com.exceed.services.FBWebHookService.processMessage(FBWebHookService.java:198) 
    at com.exceed.services.FBWebHookService.handleAudio(FBWebHookService.java:181) 
    at com.exceed.services.FBWebHookService.processMessageByType(FBWebHookService.java:150) 
    at com.exceed.services.FBWebHookService.processRequest(FBWebHookService.java:108) 
    at com.exceed.providers.fbmessenger.FBWebHook$1.run(FBWebHook.java:47) 
    at java.lang.Thread.run(Thread.java:748) 

我試過尋找一些環境變量與谷歌的關鍵,或任何其他鍵安裝在我的電腦 - 但沒有發現任何東西。

僅僅是明確的,即誤差時只在我安裝了gcloud控制檯我的本地計算機..

感謝您的幫助!

回答

0

已解決: 在我的.config目錄中,有一個包含apiKey的googleCloudConfig,我刪除它並且一切正常。