Copy link to clipboard
Copied
I am trying to run the OCR operation in a ThreadPool. My code looks like this:
ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(5);
executor.submit(() -> {
Credentials credentials = Credentials.serviceAccountCredentialsBuilder()
.fromFile("/home/darvasr/dc-services-sdk-credentials.json")
.build();
ExecutionContext executionContext = ExecutionContext.create(credentials);
OCROperation ocrOperation = OCROperation.createNew();
But when the ExecutionContext instance gets created the run fails and exception occurs when the AuthenticatorFactory calls this:
return new JwtAuthenticator((ServiceAccountCredentials) credentials);
Detailed exception:
What could be the problem (Same happens when I run it without the ThreadPoolExecutor) ? The OCR-ing works in a separate project.
Copy link to clipboard
Copied
@darvasr It seems to be that dependencies are not loaded correctly. Could you please share the dependencies list which are added in the pom.xml to setup this project ?
JOSEException is part of nimbus-jose-jwt jar which is a dependency which should be automatically fetched as part of pdftools-sdk's dependencies. I think there might be some conflict with some other version jar which may result in this issue.