[EXCONTRANS-403] Check connection fail to CTSX Google Translator Created: 02/Oct/23  Updated: 10/Oct/23

Status: In Progress
Project: Content Translation Extended (CTX)
Component/s: Google Translator
Affects Version/s: 3.4.7
Fix Version/s: None

Type: Bug Priority: Major
Reporter: HaiQuang Bui Assignee: Teresa Miyar
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 1h
Original Estimate: Not Specified

Attachments: PNG File image-2023-10-09-10-04-07-459.png     PNG File image.png    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Steps to reproduce

  1. Configuration google
  2. Add Client ID and Client Secret to config JCR
  3. Go to Tools -> Translation Extend -> Add Batch -> Choose config Google.com and Check connection

.. Logs, screenshots, gifs...

Expected results

.. Justify non-trivial expectations with a link to a doc or a relevant discussion.

Actual results

Error:

com.google.cloud.translate.Translate

RpcInvocationException: Unable to invoke method click in com.vaadin.shared.ui.button.ButtonServerRpc
caused by InvocationTargetException
caused by MethodException: Invocation of method buttonClick in info.magnolia.translation.ext.core.app.batch.renderer.NoDisableButtonActionRenderer$DefaultActionView$1 failed.
caused by ExecutionError: java.lang.NoClassDefFoundError: Lcom/google/cloud/translate/Translate;
caused by NoClassDefFoundError: Lcom/google/cloud/translate/Translate;
caused by ClassNotFoundException: com.google.cloud.translate.Translate

Workaround

Development notes



 Comments   
Comment by Teresa Miyar [ 02/Oct/23 ]

Hi,

The error you get: NoClassDefFoundError: Lcom/google/cloud/translate/Translate suggests you are missing a dependency, I will update the documentation to reflect this:

 

<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-translate</artifactId>
  <version>1.22.0</version>
</dependency>

 

Comment by HaiQuang Bui [ 02/Oct/23 ]

Hi,
I added dependency, but still has error(CTSX Google Translator version 3.4.8)
You are currently running with version 2.2.0 of google-api-client. You need at least version 1.15 of google-api-client to run version 1.22.0 of the Translate API library.
RpcInvocationException: Unable to invoke method click in com.vaadin.shared.ui.button.ButtonServerRpc
caused by InvocationTargetException
caused by MethodException: Invocation of method buttonClick in info.magnolia.translation.ext.core.app.batch.renderer.NoDisableButtonActionRenderer$DefaultActionView$1 failed.
caused by ExceptionInInitializerError
caused by IllegalStateException: You are currently running with version 2.2.0 of google-api-client. You need at least version 1.15 of google-api-client to run version 1.22.0 of the Translate API library.

Comment by Teresa Miyar [ 02/Oct/23 ]

Hi,

Sorry, I put the wrong version, it should be:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-translate</artifactId>
<version>2.22.0</version>
</dependency>

Comment by HaiQuang Bui [ 09/Oct/23 ]

Hi Teresa Miyar.

We had change version to 2.22.0 but show error when check connection

Comment by Yen Lac Tue [ 09/Oct/23 ]

Hi haibq ,

Could you please give me detail error log for this case?
You can try with "Instant translation" function, using your Google credential, it can print more detail like bellow

Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
GET https://translation.googleapis.com/language/translate/v2?key=AIzaSyBHhumzRDD5hP0hmW-50GzU75SwZIlfWx0&q=%3Cp%3Etranslate%20elected%20element%26nbsp;%3C/p%3E%0A%0A%3Cp%3Etext%20and%20image%3C/p%3E%0A%0A%3Cp%3Eadmin%20security%3C/p%3E%0A&source=en&target=de
{
  "code" : 403,
  "errors" : [ {
    "domain" : "usageLimits",
    "message" : "User Rate Limit Exceeded",
    "reason" : "userRateLimitExceeded"
  } ],
  "message" : "User Rate Limit Exceeded"
} 

Thanks!

Generated at Mon Feb 12 00:30:54 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.