I have an applet that uses the jna Pointer class. Applet code:
import com.sun.jna.*; public class Applet1 extends Applet{ public void test() { try { Pointer p = new Memory(73); } catch (Exception e) { e.printStackTrace(); } } }
In the html code, I declared the applet as follows:
<applet codebase=/pki/ code=Applet1.class archive=/pki/jna-3.2.3.jar id=Applet1 width=100 height=100 > </applet>
When I call document.getElementById ("Applet1"). test () by javascript raises java.lang.reflect.InvocationTargetException. I cannot call e.getCause () in the java class because the try / catch applet will not catch the error (I don't understand why). But javascript try / catch caught this error. If you move the line Pointer p = new Memory(73); it will be ok. The point is this line. Please help fix the problem.
EDIT: if replacing this block:
try { Pointer p = new Memory(73); } catch (Exception e) { e.printStackTrace(); }
to
try { Pointer p = new Memory(73); } catch (Throwable e) { System.out.println(e.getCause()); }
I got java.security.AccessControlException: access denied (java.util.PropertyPermission jna.boot.library.path read)
source share