Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6229589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:35:46+00:00 2026-05-24T09:35:46+00:00

I have applet which use jna Pointer class. The applet code is: import com.sun.jna.*;

  • 0

I have applet which use jna Pointer class. The applet code is:

import com.sun.jna.*;
public class Applet1 extends Applet{
    public void test() {
        try {
            Pointer p = new Memory(73);
        } catch (Exception e) {
        e.printStackTrace();
        }
    }
}

In html code I declared applet this way:

<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 the java.lang.reflect.InvocationTargetException arise.
I cant call e.getCause() in the java class side, because applet try/catch dont catch the error (I dont understand why). But javascript try/catch catch this error.
If move Pointer p = new Memory(73); line it will be ok. The matter is this line.
Please, help to fix the problem.

EDIT: if replace 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)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:35:47+00:00Added an answer on May 24, 2026 at 9:35 am

    Okay, now we come to the root of the problem. (You still could have used printStackTrace – this should have printed the stack trace of the cause, too.).

    1. Unsigned applets have only access to a limited number of system properties – the jna properties are not part of these.

    2. In an unsigned applet you can’t load native libraries anyways, so no way to use JNA (or JNI, by the way).

    3. If you sign the applet (and tell the plugin to accept the signature), your applet has the necessary rights to use JNA. But the rights of any single running code is effectively the intersection of the rights of all methods which called the current code.

      Applet methods called from JavaScript have extremely limited permissions (since the Plugin can’t really check that the JavaScript code has the necessary permissions, if your browser even has such a concept).

      You can go around this by wrapping the part of the code, which needs to run with your applet’s permissions, with AccessController.doPrivileged(...). But first make sure this can’t do anything dangerous (which is easy with JNI/JNA), even when called from malicious JavaScript code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a java applet application in which i use rich text area .
I have an applet which runs in a browser and is called from Javascript.
I have written a java applet which opens a JFrame (so when run in
Code below is pseudo code. Imagine a class Fruit which has a factory method
I have developed an applet java with Eclipse, which is included in MyPage.html. I
I use Java Applet like an example. When you open a website which has
I have a Java Applet application. The use case is as follows: The users
I have been trying to use JScrollPane with my applet, but it doesn't work.
I have a jar file which is used in html file as applet. I
I have created a UITableViewCell using UITableViewCellStyleValue1, which the Apple docs define as: A

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.