Calling MonitorExit after ThrowNew has the side effect of clearing the exception just thrown. This behavior does not match java 1.5. To reproduce using the attached files (a small test case):
javac Test6.java
javah Test6
cc -G -I/usr/j2se/include -I/usr/j2se/include/solaris Test6.c -o libtest6.so
LD_LIBRARY_PATH=. java Test6
Switching the order of these lines
(*env)->ThrowNew(env, jxc, "error");
(*env)->MonitorExit(env, jc);
in Test6.c, or reverting to Java 1.5 causes the exception stack trace to print on the console as expected.
The version of Java was obtained from /net/koori.sfbay/onestop/jdk/6/promoted/latest/bundles/solaris-i586/pkgarchive
Dec 8, 2005