Oliver,
>So what you say is that when an exception was triggered in the java
>code using JNI version <1.3, it was properly transmitted to the
>catch statement in the C++ code, but since version 1.3, the exception
>cannot be caught in C++ anymore, right ?
Sort-of. Exceptions generated in the C++ native code called by JNI
functions do not receive the exceptions. Instead, the JVM gets the
exception, and complains that an 'unexpected exception occurred in
native code."
So if you have a C++ function that runs as native code under JNI, and
it uses exceptions, the exception is never seen by the C++ code, and it
causes an unexpected and usually fatal exception in the JVM.
>This could be a problem for me.
Yes, for me too. Until we either convince sun to fix this, or I can
find a workaround, I can only support the 1.2.2 JDK, which luckily
is still available on java.sun.com.
>Thanks for the info, I did not know that.
You're welcome. If you have any contacts at SUN, be sure to let them
know how unhappy you are about this. I have - bigtime.
>Do you have any idea why they did drop support for this ?
I think something they did inadvertantly broke this, and rather than
fix the problem, they are hiding behind the letter of the Java Spec.
It's true that there is no guarantee that these features will work,
but since most JNI programming is written in C++, it's damn stupid of
them to refuse to fix this.
I'm hoping if enough people complain, that they will fix it in a later
version of the JDK. Only exception handling seems to be broken, but they
specifically said that they also do not guarantee templates or RTTI will
work either now, or in the future. That makes me even more nervous.
What is the point of C++ without these features? Only the OO features.
You might as well just use C instead.
--Carl
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]