I have an applet the loadslibrary using a System call through a static method called loadLibrary.
System.loadLibrary("ReadRegistry");
This works fine as long as I call loadLibrary from within the applet. However, if from javascript I access another method, called handleLoad(), which calls the loadLibrary method, I get a java security error when I try to call the System.loadLibrary statement.
Why would that be?
Once a call is invoked by JS, a JRE becomes less trusting of it.
To solve that, wrap the problem code in a
PrivilegedActionand call it using one of theAccessController.doPriviliged()variants.