Run an applet in an address space different from the one of Firefox image
I'm dealing with a very specific problem. I'm developing an applet (no, unfortunately they want an applet, Java Web Start is not applicable) that needs to access Firefox certificate store.
Mozilla provides JSS (Network Security Services for Java) that, given a Firefox (or Thunderbird) profile directory, lets the programmer access all the certificates and several cryptographic facilities.
Now, the problem. My signed applet can do anything a Java program is allowed to do. So I can load the native libraries required to run JSS. The issue is that I get an access violation while working with it, and I know why. The crashes happens in a module called mozcrt19.dll, which seems to be a "custom" C runtime library for Mozilla, whereas jss4.dll and friends are most likely tested on MS standard C runtime. The crashes doesn't happen if mozcrt19.dll is not loaded, ie. the applet is run outside of the browser address space, for example with Java Web Start.
The question, in short terms, is: since the only way I can get rid of that module is breaking out the Firefox address space, how can I run my java applet, without Java Web Start, out of that address space?
Or, can you suggest me any workaround, trick, hack or whatsoever to achieve the sam开发者_如何学Goe effect? I'm open to any suggestion.
Thanks in advance.
You don't have to run the applet itself in a separate address space. You could have it launch a separate process to access the certificates, and communicate back to the applet running in the browser process.
please Make sure from this :
Windows
- Create jss directory under Mozilla's installed directory.
- Copy JSS JAR file into the jss directory.
- Copy JSS native library DLL into Mozilla's installed directory.
Linux / Solaris
Create jss directory under Mozilla's installed directory.
Copy JSS JAR file into the jss directory.
Copy JSS native library .so into Mozilla's installed directory.
Set environment variable MOZILLA_HOME to Mozilla's installed directory in Mozilla's launch script.
Change environment variable LD_LIBRARY_PATH to include Mozilla's installed directory in Mozilla's launch script.
精彩评论