Hi, im trying to process multiple images in multiple threads of a class named OCR
(code in green, exception in red)
i get an exception before i but in a picture.
public class OCR implements Runnable {
String ThreadNr;
OcrEngine ocr;
public OCR(String Thread) {
ThreadNr = Thread;
}
@Override
public void run() {
ocr = new OcrEngine();
while (true) {
System.out.println("Thread nr.: " + ThreadNr);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
}
}
}
I create and start the threads with the main class
public static void main(String[] args) throws IOException, TesseractException {
Thread t0 = new Thread(new OCR(“1”));
t0.start();
Thread t1 = new Thread(new OCR(“2”));
t1.start();
}
when i run one of them it’s ok, but when i run two i get exceptions like this:
Exception in thread “Thread-0” class com.aspose.ocr.internal.bcc: Resource file is not correct. —> class com.aspose.ocr.OcrException: Unknow type. Use ResourceType or DrFontStyle only.
com.aspose.ocr.internal.bbx.a(Unknown Source)
com.aspose.ocr.internal.bcb.a(Unknown Source)
com.aspose.ocr.LanguageFactory.a(Unknown Source)
com.aspose.ocr.LanguageContainer.a(Unknown Source)
com.aspose.ocr.LanguageContainer.(Unknown Source)
com.aspose.ocr.OcrEngine.(Unknown Source)
javaapplication12.OCR.run(OCR.java:25)
java.lang.Thread.run(Thread.java:745)
— End of inner exception stack trace —
com.aspose.ocr.internal.bcb.a(Unknown Source)
com.aspose.ocr.LanguageFactory.a(Unknown Source)
com.aspose.ocr.LanguageContainer.a(Unknown Source)
com.aspose.ocr.LanguageContainer.(Unknown Source)
com.aspose.ocr.OcrEngine.(Unknown Source)
javaapplication12.OCR.run(OCR.java:25)
java.lang.Thread.run(Thread.java:745)
at com.aspose.ocr.internal.bcb.a(Unknown Source)
at com.aspose.ocr.LanguageFactory.a(Unknown Source)
at com.aspose.ocr.LanguageContainer.a(Unknown Source)
at com.aspose.ocr.LanguageContainer.(Unknown Source)
at com.aspose.ocr.OcrEngine.(Unknown Source)
at javaapplication12.OCR.run(OCR.java:25)
at java.lang.Thread.run(Thread.java:745)
Caused by: class com.aspose.ocr.OcrException: Unknow type. Use ResourceType or DrFontStyle only.
com.aspose.ocr.internal.bbx.a(Unknown Source)
com.aspose.ocr.internal.bcb.a(Unknown Source)
com.aspose.ocr.LanguageFactory.a(Unknown Source)
com.aspose.ocr.LanguageContainer.a(Unknown Source)
com.aspose.ocr.LanguageContainer.(Unknown Source)
com.aspose.ocr.OcrEngine.(Unknown Source)
javaapplication12.OCR.run(OCR.java:25)
java.lang.Thread.run(Thread.java:745)
at com.aspose.ocr.internal.bbx.a(Unknown Source)
… 7 more