Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Info on JNI exception handling

843829Aug 3 2004 — edited Aug 4 2004
Hi,

Consider the scenario where a Java app uses JNI for accessing native methods.

I found one documentation saying that whenever environment related calls are made on the native side like
env->FindClass (DI_PROP);
we have to call functions env->ExceptionOccurred(), env->ExceptionDescribe(env) and env->ExceptionClear(env).

Can some one explain why this is required? Also is there any way to get the error string from env->ExceptionDescribe(env) so that it can be assigned to some string variable in code?

Regards,
Harish

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 1 2004
Added on Aug 3 2004
9 comments
694 views