abbyy / ocrsdk.com

ABBYY Cloud OCR SDK
http://ocrsdk.com/github
Apache License 2.0
504 stars 483 forks source link

NullPointer Exception in Java #100

Closed Arjungowda1 closed 11 months ago

Arjungowda1 commented 11 months ago

Hello, I am using test credentials to process PDFs as valid unused credentials but getting exception without a proper cause.

Here's a stack trace: image

and this is the code

               AuthInfo authInfo = new AuthInfo(host, id, password);
                OcrClient client = new OcrClient(authInfo);
                ImageProcessingParams imageProcessingParams = new ImageProcessingParams();
                imageProcessingParams.setExportFormats(new ExportFormat[]{getFormat(responseType.getFormat())});
                imageProcessingParams.setLanguage(language == LangaugeList.English ? language.toString() : 
                "English,".concat(language.toString()));
                CompletableFuture<TaskInfo> asyncMethod = client.processImageAsync(imageProcessingParams, file.getInputStream(), 
                file.getName(), true);
                TaskInfo taskInfo = asyncMethod.get();
                HttpGet httpGet = new HttpGet(taskInfo.getResultUrls().get(0));
                HttpClient httpclient = HttpClients.createDefault();
                HttpResponse response = httpclient.execute(httpGet);