User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9) Gecko/2008052906 Firefox/3.0 Build Identifier: xulrunner 22.214.171.124 This happens because the thread which verifies the certificate is not attached to JVM Reproducible: Always Steps to Reproduce: 1. 2. 3. Actual Results: Сrash
Created attachment 329852 [details] [diff] [review] Attache current thread patch This patch fix this problem. Only the one problem, no name of thread which I attache to JVM . But now in this code, I caught only in the case of SSL
Comment on attachment 329852 [details] [diff] [review] Attache current thread patch Javier, I'm going to let you decide whether this is the right fix here or not.
Sorry for very badly description of . I'll try to make more detailed description: There is Mozilla which is embedded into Java using JavaXPCOM bridge. There is a nsIWebBrowser instance, which navigates into some https:// resource with invalid or self-signed SSL certificate. With current implementation it's brings to JVM crash. As you can know, JNI is not thread safe. JNI context is valid only for one thread, and each thread which is uses JNI must be attached into JVM first. Otherwise JVM will crashes. It is described at: http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/invocation.html#wp1060 So the attached patch makes modification in JavaXpcom JNI part. This modification connect to JVM each thread that makes attempt to use JavaXPCOM. If connection is impossible for some reason, the Java exception is throws to JVM and there aren't any crashes occurs.