Problem using Java Native Interface on Debian

Hi all,

First visit to this forum, hope I've chosen an appropriate place to post this.

I have a Java-based application that uses native C++ libraries (built with g++-4.0) for specialized, computation-intensive routines.

Within the native code, I need to catch exceptions thrown inside called methods and throw a corresponding Java exception back to the JVM. This used to work just fine. But I am performing a rebuild after some time has past, and our platform itself (Debian testing) has had some upgrades (to glibc, etc.). Consequently, the desired functionality seems to be broken. The exceptions are not being caught in the new build.

Note: the same code built and tested on MS Windows platforms works just as expected.

Here is a snippet some of the code that is failing:

/*
 * Class:     informeta_mentys_api_license_FileLicense
 * Method:    nativeReadExpiry
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_informeta_mentys_api_license_FileLicense_nativeRea
(JNIEnv *env, jclass cls)
{
  jlong expiry(0);
  try
  {
    expiry = FileLicense::getInstance().readExpiry();
  }
  catch (LicenseException& e)
  {
    env->ThrowNew(Class_LicenseException, e.getMessage().c_str());
  }
  catch (JNIException&)
  {
    // Do nothing; exception already pending from failed JNI call
  }
  catch (...)
  {
    env->ThrowNew(Class_LicenseException, "unidentified runtime error");
  }
  return expiry;
}

Here is the error message that the system gives:

terminate called after throwing an instance of 'informeta::mentys::security::LicenseException'

Any input or advice would be terrific.

Matthew

P.S. I now realize that this is a poor choice of forum for my question. If it would be more appropriate, could a moderator please move this to Network Computing Topics > C Programming in the UNIX Environment. I see there is a g++-4.0 thread over there. Sorry.