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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:18:03+00:00 2026-06-10T03:18:03+00:00

Okay so I was parsering an XML file using JAVA DOM. Whenever the program

  • 0

Okay so I was parsering an XML file using JAVA DOM.
Whenever the program gets to the point where it is supposed to parser the XML file, I get a “AccessControlException” saying “access denied”.
I have parsered many XML files using JAVA DOM and this is the first time I have gotten this exception.
What am I doing wrong?

Here is the XML file:

<?xml version="1.0" encoding="UTF-8" ?>
<root>

</root>

Here is the code that is supposed to parser it:

DocumentBuilderFactory bdf = DocumentBuilderFactory.newInstance();
        DocumentBuilder bd = bdf.newDocumentBuilder();
        Document doc = bd.parse("excersize.xml");

Finally here is the error I get:

java.security.AccessControlException: access denied ("java.io.FilePermiss
ion" "\excersize.xml" "read")

Edit

Luckily after some time I got it to work using a policy file however for whatever reason it only works if I type the full directory of the xml file

This works:

Document doc = builder.parse("file:/B:/Programming/Java/Programs/new/excersize.xml");

but this doesn’t:

Document doc = builder.parse("excersize.xml"); //The xml file is in the same directory as the java source file, the class file, and the html file

although this is tolerable, I do like to keep my files “mobile ready” so that they don’t have any concrete adresses but rather adresses relative to the .java and .class file. Any help at all to help me figure out this problem would be greatly appreciated 🙂

  • 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-10T03:18:05+00:00Added an answer on June 10, 2026 at 3:18 am

    The exception says it all, you are trying to access a file the JVM can’t access.
    Maybe you can take a look at the documentation

    EDIT

    By default, applets can’t access the client’s file I/O.
    You need to sign your applet or edit the policy files to allow it

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

Sidebar

Related Questions

Okay, so I'm using perl to read in a file that contains some general
I'm having some trouble using XmlReader to read an XML file. I can open
Okay, so I'm working on a java server for an Apps backend, it must
Okay. Here's the code. XML Parsing Error: not well-formed <item_to_page_title><![CDATA[Breaking news, real-time scores and
Okay, so I've written a REST API implementation using mod_rewrite and PHP. I'm accepting
Okay here is a very common xml parsing method, getting child nodes, but it's
Okay so I am pretty much doing a crash course through creating a java
Okay, first, I'm a noob at android programming. I have taken some Java, but
Assuming I have a sample configuration XML file that is the following: <?xml version=1.0?>
Okay, I've looked all over the internet for a good solution to get PHP

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.