dcsimg
Problem when throwing an exception in JNI Code
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Dietmar_Brader
Posted On:   Tuesday, June 18, 2002 01:06 AM

I am throwing an Exception in my JNI code like in the following code example: jclass excCls = env->FindClass ("java/lang/IllegalArgumentException"); if (excCls != 0)    env->ThrowNew(excCls, "thrown from native code"); When the exception occurs, the catch block in my java code is not reached and the programm continues in my JNI code as if no exception has been thrown. (This behavior is the same in VisalAge Java and in JRE 1.3.1) But if i run my code in VisualAge Java and first start the debugger once, my catch block will be evaluated. Has anyone an idea what the problem is???    More>>

I am throwing an Exception in my JNI code like in the
following code example:


jclass excCls = env->FindClass ("java/lang/IllegalArgumentException");

if (excCls != 0)

   env->ThrowNew(excCls, "thrown from native code");


When the exception occurs, the catch block in my java
code is not reached and the programm continues in my
JNI code as if no exception has been thrown. (This
behavior is the same in VisalAge Java and in JRE 1.3.1)


But if i run my code in VisualAge Java and first start
the debugger once, my catch block will be evaluated.


Has anyone an idea what the problem is???


Dietmar

   <<Less
About | Sitemap | Contact