Problem using Java Native Interface on Debian


 
Thread Tools Search this Thread
Top Forums Programming Problem using Java Native Interface on Debian
# 1  
Old 01-25-2006
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 12:20 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

can i have an optimal solution for this java code ? Facing Java heap space problem even at 3GB heaps

My desired output is run: for this 1 for this 2 for this 3 for this 4 for this 5 for this 1,2 1->2 for this 2,3 2->3 for this 3,4 3->4 for this 4,5 4->5 for this 1,2,3 1->2,3 (2 Replies)
Discussion started by: vaibhavkorde
2 Replies

2. Solaris

Network interface problem

HI, genunix: NOTICE: ce0: xcvr addr:0x01 - link up 100 Mbps half duplex genunix: WARNING: ce0: fault detected external to device; service degraded genunix: WARNING: ce0: xcvr addr:0x01 - link down genunix: NOTICE: ce0: fault cleared external to device; service available genunix: ... (4 Replies)
Discussion started by: sunnybee
4 Replies

3. Solaris

Network interface problem

Hi i have replace a NIC card on solaris 10 when i give the following command ifconfig -a it just show the lo0 (only loop back with inet 127.0.0.1) when i give the following command to config the interface, ifconfig elxl0 plumb ifconfig: plumb: elxl0: no such interface please help... (11 Replies)
Discussion started by: malikshahid85
11 Replies

4. Debian

Problem with graphical interface

Hi, i have problems with an installation of Debian i386 505 in a pc. The hardware it is a mother soyo with a chipset via. When i install the xorg, the installation it`s succesfull, but when i type startx, the pc don`t respond. I am from Argentina and my English it isn`t good. Sorry. (0 Replies)
Discussion started by: Kritar
0 Replies

5. Programming

libcurl multi interface problem

Hello, I'm trying to use libcurl multi interface to fetch several data in parallel. I would expect this to be faster than performing repeated fetches using the easy interface, but for some reason I can't obtain any speed up at all: using the multi interface actually turns out to be MUCH slower than... (2 Replies)
Discussion started by: clalfa
2 Replies

6. Debian

How to install Java in Debian Lenny

Hi all im trying to install Java in Debian lenny with apt-get install but can find the packages...anyone can help me on this one? thanks (2 Replies)
Discussion started by: ro0t3d
2 Replies

7. UNIX for Advanced & Expert Users

interface problem

hi all, i have problem with my box, until now i can't investigate the root cause of my issue at my box. here the problem. i have a box as a squid server just forward all request packet from one interface and receive the packet then forward to client at the same interface. but after 5 hours i... (1 Reply)
Discussion started by: tindasz
1 Replies

8. Debian

Trying to native compile Debian Dialog

Hi, tried to native compile Debian Dialog as ncurses-dev is available. I am trying native compile Debian Dialog using gcc on Linux embedded router. What's wrong, as running than make I get errors. Mayby this line in the log file is an exaplanation to a problem ? " checking if we have... (1 Reply)
Discussion started by: jack2
1 Replies

9. AIX

Problem with a Network Interface

Hi every body, I have a Fiber Channel interface (fcs2) in AIX 5.2. This interface was fine & up but for some reason I could not return this interface UP again after I set it DOWN. When I tried to set this interface UP I encountered the following error: Method error... (7 Replies)
Discussion started by: aldowsary
7 Replies

10. UNIX for Advanced & Expert Users

network interface problem

Hi expert, Need some help on network interface issue.. I have added 2 x NIC card onto the Ultra 2 system recently and configured as hme1 and hme2. I have unconfigured the onboard hme0 network interface and it was running fine till few days later, i keep recieving error messages showing hme0... (6 Replies)
Discussion started by: sc2005
6 Replies
Login or Register to Ask a Question