Hi ALL,
I have a C++ app that invokes
Java classes on 64-bit Solaris 10 with 64-bit JVM.
Here is the problem:
The native non-main (not the
thread that initializes the JVM) threads would not be able to find any user-define class and run into StackOverflowError.
Here are the symptoms and observations:
1. The "main thread" that instantiates the JVM has no problem finding and loading any class or method
2. But the other threads (non-main threads) would not be able to find the user-defined classes unless the classes were already loaded by the main thread.
3. The non-main threads can find the "standard" java classes with no problem
4. The same app ran fine on 32-bit system.
5. Except for the JVM reference is global, I already have each thread acquired JNIEnv by either GetEnv() or AttachCurrentThread().
6. JNIEnv::ExceptionDescribe() showed the following StackOverflowError:
7. Here is the sample code that reproduces the problem:
Any idea why it is a problem with 64-bit?
I really appreciate it if anyone can provide any help/suggestion.
Regards,
- Triet