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 8367275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:07:02+00:00 2026-06-09T13:07:02+00:00

I am developing a JavaFX application that needs to access files on the users

  • 0

I am developing a JavaFX application that needs to access files on the users system. I know that my application must be signed before it could have such access, so i signed my app. But the app still throws java.security.AccessControlException

-The Application

public class TestApp extends Application
{
    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) 
    {
         launch(args);
    }

    @Override
    public void start(Stage primaryStage) 
    {
         primaryStage.setTitle("Hello World!"); 
         StackPane root = new StackPane();
         primaryStage.setScene(new Scene(root, 300, 250));
         primaryStage.show();
    }

    public void callJSFunc(JSObject func) 
    {
         File fleExample = new File("F:/myfile.xml");
         func.call("call", fleExample.exists());
    }
}

Then i went on to sign the app

keytool -genkey -keystore myKeyStore -alias me
keytool -selfcert -keystore myKeyStore -alias me  
jarsigner -keystore myKeyStore TestApp.jar me

So i called the apps callJSFunc from javascript

function deployIt() 
{
      dtjava.embed(
      {
          id: "my2",
          url: "TestApp.jnlp",
          width: 300,
          height: 200,
          placeholder: "here"
       },
       { 
          javafx: "2.1+", 
           jvm: "1.6.0+" 
       },
       {
           onJavascriptReady: callApp
       });
}

function callApp(id) 
{
   var app = document.getElementById(id);
   app.callJSFunc(function(e){ alert(e); });
}

dtjava.addOnloadCallback(deployIt);

But my app outputed this on the browser

Uncaught Error: java.security.AccessControlException: access denied ("java.io.FilePermission" "F:/myfile.xml" "read") 

Also, i tested the app on my localhost. I don’t understand why its throwing this exception after siging the app. Please what am i doing wrong? Thanks

  • 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-06-09T13:07:03+00:00Added an answer on June 9, 2026 at 1:07 pm

    Don’t use the keytool and jarsigner to sign the app.

    Instead package, sign and ready your app for deployment using the javafx deployment tools such as javafxpackager or the JavaFX ant tasks.

    Make sure that your jnlp file requests elevated permissions. If you are using the JavaFX ant tasks, you can request JavaFX to generate an appropriate jnlp with elevated permissions using a fx:permissions clause.

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

Sidebar

Related Questions

I'm just playing around with JavaFX 2 and developing a little application for my
Iam developing one application.In that iam placing the radio buttons(uiimageview) on table view and
I am developing a web application using JSF on Netbeans 7.0. I have created
I'm developing a java servlet web application that manages information from multiple databases (all
I tried to start developing an NB platform application that holds a JFXPanel in
I am developing a Java Swing application but I want to also use JavaFX
I'm developing a JavaFx 2.0 application using Netbeans 7. The main application references another
I am developing an application in which i have to read the contents of
/* Hi Iam developing an application where the BB app needs to post data
I'm developing a JavaEE system (distributed on Weblogic App Server), but I don't have

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.