I am working with IBM's J9 java virtual machine in a Windows Mobile device. I access native code using JNI and I have recently experienced a problem concerning threads. I've noticed that when I create a thread from native code (using win32) and call Java methods, I don´t have the same permissions as when using Java threads. More specifically, if I try to open a file from the device's file system I get a NullPointerException that at

com.ibm.oti.security.midp.PermissionManager.getMan ager
com.ibm.oti.connection.file.Connection.checkSecuri ty
com.ibm.oti.connection.file.Connection.setParamete rs
com.ibm.oti.connection.file.Connection.setParamete rs2

Has anyone experience this problem before? Or do you have any ideas on how to solve it?

I also have another question: what's the thread model used by J9? I've read in JNI's documentation that depending on the JVM implementation there could be synchronization problems between java threads and native threads.

Thank you very much in advance.