The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem with a Network Interface aldowsary AIX 7 10-09-2007 06:26 PM
network interface problem solaris 2.5 kroegand SUN Solaris 0 05-25-2006 10:11 PM
problem in new debian installation gauri_agr UNIX for Dummies Questions & Answers 5 01-23-2006 10:20 PM
network interface problem sc2005 UNIX for Advanced & Expert Users 6 08-07-2005 08:59 PM
Debian aptitude - apt-get problem mikek147 UNIX for Advanced & Expert Users 1 09-15-2002 05:13 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-25-2006
QED QED is offline
Registered User
 

Join Date: Jan 2006
Posts: 1
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:
Code:
/*
 * 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:
Code:
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.

Last edited by QED; 01-25-2006 at 08:20 AM.
Reply With Quote
Google UNIX.COM
Forum Sponsor
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0