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

  • SEARCH
  • Home
  • 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 252477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:40:52+00:00 2026-05-11T21:40:52+00:00

The following applet is compiled and packed into jar which is then signed with

  • 0

The following applet is compiled and packed into jar which is then signed with a self-signed cert.

import java.applet.Applet;
import java.io.File;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;

public class Test extends Applet {
        private static final long serialVersionUID = -3127185193501384816L;

        private final class DirectoryLister implements PrivilegedAction<File[]> {
                private final String attachmentsFolder;

                private DirectoryLister(String attachmentsFolder) {
                        this.attachmentsFolder = attachmentsFolder;
                }

                public File[] run() {
                        return new File(attachmentsFolder).listFiles();
                }
        }

        public File[] getFiles() throws PrivilegedActionException {
                String attachmentsFolder = getParameter("attachmentsFolder");

                if (attachmentsFolder != null) {
                        return AccessController.doPrivileged(new DirectoryLister(
                                        attachmentsFolder));
                }

                return null;
        }
}

Applet is instantiated as follows:

<applet id="applet"
    code="Test"
    archive="applet.jar">
    <param name="attachmentsFolder"
        value="c:/test" />
</applet>

Applet is used as follows:

var files = applet.getFiles();

for (var file in files) {
    // Do something to file.
}

The ff. error is encountered:

java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sun.plugin.javascript.JSInvoke.invoke(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
        at sun.plugin.liveconnect.PrivilegedCallMethodAction.run(Unknown Source)
        ... 4 more
Caused by: java.security.AccessControlException: access denied (java.io.FilePermission c:\test read)
        at java.security.AccessControlContext.checkPermission(Unknown Source)
        at java.security.AccessController.checkPermission(Unknown Source)
        at java.lang.SecurityManager.checkPermission(Unknown Source)
        at java.lang.SecurityManager.checkRead(Unknown Source)
        at java.io.File.list(Unknown Source)
        at java.io.File.listFiles(Unknown Source)
        at Test$DirectoryLister.run(Test.java:20)
        at Test$DirectoryLister.run(Test.java:1)
        at java.security.AccessController.doPrivileged(Native Method)
        at Test.getFiles(Test.java:28)
        ... 14 more

Which leads me to ask if I still need to explicitly grant perms in one of the config files in the Java home directory to read c:/test? If so, can anyone point me to a guide on how to do this?

  • 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-11T21:40:52+00:00Added an answer on May 11, 2026 at 9:40 pm

    Caching problem apparently. Clearing all caches and re-building/re-deploying solved the problem. I.e., no additional perms set-up needed.

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

Sidebar

Related Questions

I write the following file temp.hs: import qualified Data.Set import System.Environment main :: IO
I have an applet, which I was writing in Java. Recently, I thought that
I have the following tuple, which contains tuples: MY_TUPLE = ( ('A','Apple'), ('C','Carrot'), ('B','Banana'),
Following up on this question, I'm working on a large Delphi 7 codebase which
I'm not sure why I get a java.lang.NoClassDefFoundError runtime error on the following line:
I'm looking at a signed Applet that is heavily called from JavaScript. Obviously, the
I need to solve the following question which i can't get to work by
I have the following CSS: html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td { background: transparent; border: 0; font-size: 100%; margin:
I compiled the following code: // Triangle.cpp // Our first OpenGL program that will
I have a java applet that I would like to include in my ASP.NET

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.