Sudarshan kumar
Sudarshan kumar

Reputation: 1585

AWS Textract: Exception in thread "main" java.lang.NoSuchMethodError

I get this error while executing the AWS Tetxtract API .

Exception in thread "main" java.lang.NoSuchMethodError: com.amazonaws.client.AwsSyncClientParams.getAdvancedConfig()Lcom/amazonaws/client/builder/AdvancedConfig; at com.amazonaws.services.textract.AmazonTextractClient.(AmazonTextractClient.java:149) at com.amazonaws.services.textract.AmazonTextractClient.(AmazonTextractClient.java:133) at com.amazonaws.services.textract.AmazonTextractClientBuilder.build(AmazonTextractClientBuilder.java:61) at com.amazonaws.services.textract.AmazonTextractClientBuilder.build(AmazonTextractClientBuilder.java:27) at com.amazonaws.client.builder.AwsSyncClientBuilder.build(AwsSyncClientBuilder.java:46) at com.tr.fundamental.s3FileUploader.AnalyzeDocument.main(AnalyzeDocument.java:177)

I have downloaded the latest Textract jar and included in my build path . I do not get any compilation error ,but when i run i get this error at this point

  // Call AnalyzeDocument 
        EndpointConfiguration endpoint = new EndpointConfiguration("https://textract.us-east-1.amazonaws.com", "us-east-1");
        AmazonTextract client = AmazonTextractClientBuilder.standard().withEndpointConfiguration(endpoint).build();

My credential and all are correct and able to connect to S3 as well. I am not sure what i am missing . Please help

Upvotes: 1

Views: 937

Answers (4)

Mohit Jain
Mohit Jain

Reputation: 1

I was also getting the same issue, I have degraded the version and the issue get resolved. It happens due to version mismatch.

Upvotes: 0

Masud Ahamed
Masud Ahamed

Reputation: 19

This is happening due to version mismatch of aws sdk and textract. Keep same version, it would start working

Upvotes: 0

Fabio Farath
Fabio Farath

Reputation: 487

A possible issue is that you are using difference artefact versions your aws libraries.

In case you are using Maven, have a look on: https://stackoverflow.com/a/55330900/2353294

Upvotes: 1

Sudarshan kumar
Sudarshan kumar

Reputation: 1585

Ok let me answer my question . So using Default client solved my issue .

    EndpointConfiguration endpoint = new EndpointConfiguration("https://textract.us-east-1.amazonaws.com", "us-east-1");
    AmazonTextract client = AmazonTextractClientBuilder.defaultClient();

Upvotes: 0

Related Questions