FCEngine.Jni.dll already loaded in another classloader: Flexicapture SDK

  • Last Post 15 May 2014
nits posted this 27 January 2014

[i'm using JAVA] I'm facing a problem while running my Flexicapture application using SDK. As per as your tutorials, 1. First load the engine 2. perform all task 3. unload the engine.

same way i'm trying to do (same as your java Hello sample code), additionally i'm using flexicapture processor for recognition process.

if any kind of exception occurs during application life cycle ( even not related to Flexicapture engine object, for example null pointer exception while accessing a object of our application) a problems occurs when i try to run our application again, FCengine.dll loaded already in classloader

i'm carefully unloading engine as below;

  // Release Engine resources
    if (engine != null) { // stop making entry in log files


    logger.debug("unloading EngineLoader and Engine");

    // release engine object

    if (engineLoader != null)

i've loaded engine as below

logger.debug("Loading Engine Objects");

        engineLoader = Engine.CreateEngineOutprocLoader();
        engine = engineLoader.Load(serialNumber, dllPath);

        if (engine == null || engineLoader == null)
            logger.debug("Failed to load engine, engine=null Or                                      engineLoader == null...... : startRecognization() ");
            return ;

        logger.debug("Engine Loaded");

          //This method enables logging of errors, warnings and method calls
          engine.StartLogging(engineLogFilePath, true);

I'm making sure the unload engine task must execute at the end the application, either any exception occurs or not, the unload engine method must be execute.

Additionally i found, in tutorials, under the title "Final Step: Unload FlexiCapture Engine" ... following code sample for unloading FCengine.dll

FCEngine::IEnginePtr Engine;
// HANDLE to FCEngine.dll
static HMODULE s_libraryHandle = 0;
BOOL UnloadFCEngine()
  if( s_libraryHandle == 0 ) {
    return TRUE;

  // Release Engine object
  if( Engine != 0 ) {

  // Check if FCEngine.dll can be unloaded
  typedef HRESULT (STDAPICALLTYPE* DeinitializeEngineFunc)();
  DeinitializeEngineFunc pDeinitializeEngine = 
    (DeinitializeEngineFunc)GetProcAddress( s_libraryHandle, "DeinitializeEngine" );

  if( pDeinitializeEngine == 0 || pDeinitializeEngine() != S_OK ) {
    return FALSE;

  // Now we can free library safely
  FreeLibrary( s_libraryHandle );
  s_libraryHandle = 0;

  return TRUE;

but can't found a way to implement the same in Java, can't found any method like DeinitializeEngineFunc()

Please suggest us a solution.

Order By: Standard | Newest | Votes
SDK_support posted this 27 January 2014

We have received your letter with this description sent to SDK_Support@abbyy.com and are already investigating your issue. As soon as we get any news, we will let you know via e-mail.

  • Liked by
  • nits
nits posted this 15 May 2014

Yet there is no reply from your side with solution. Pls help us to resolve this issue asap

SDK_support posted this 15 May 2014

Probably there was some technical issue with the e-mail - we have send you our letter once more. Can you please check your e-mail and let us know whether you have received it?