Symptoms
In the multithreading Java application, the exceptions appear on Engine initialization sporadically:
Unknown error. Error code: 0x62 Diagnostic Message: Tcp endpoint error.
com.abbyy.Outproc.FREngine.EngineException: Unknown COM error: 80004005, 80070024
Cause
The reason is that the protection service doesn't have enough time to distribute "permission to use Engine" to several threads simultaneously.
Resolution
There are 2 workarounds here so far:
1. Set several initialization attempts, as it's done in the original Multithreading sample.
// Multithreading (Java) sample
// Load ABBYY FineReader Engine
final int triesToInit = 3;
boolean engineIsLoaded = false;
for( int i = 0; i < triesToInit && !engineIsLoaded; ++i ) {
if( i != 0 ) {
displayMessage( "An error occurred while initializing; retrying..." );
}
try {
engineIsLoaded = loadEngine();
} catch( Exception ex ) {
displayException( ex );
}
}
2. Set a short pause (1-2 seconds may be enough) between thread starts.
// Multithreading (Java) sample
for( final String imageName : imagesNames ) {
Runnable runnable = new ThreadJob( ++jobIndex, imageName );
Thread thread = new Thread( runnable );
thread.start();
Thread.sleep(1000);
}
Comments
0 comments
Please sign in to leave a comment.