Jump to content

java.security.AccessControlException: access denied

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
ld_pvl

ld_pvl

    Learning Programmer

  • Members
  • PipPipPip
  • 46 posts
I'm writing a GUI Applet Application which is going to be run on a server. I have tested the program occasionally and it has been working fine. Lately, I needed to add another function which would allow the program to read some data from a CSV file which is stored in the same folder as my application jar file on the same server.

In my knowledge, applet applications are allowed to read files that are located on the same server. But in my case it does not work. Please help, thank you.

java.security.AccessControlException: access denied (java.io.FilePermission Default.csv read)

        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)

        at java.security.AccessController.checkPermission(AccessController.java:546)

        at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)

        at java.lang.SecurityManager.checkRead(SecurityManager.java:871)

        at java.io.FileInputStream.<init>(FileInputStream.java:100)

        at java.io.FileInputStream.<init>(FileInputStream.java:66)

        at java.io.FileReader.<init>(FileReader.java:41)

        at fdrs.FX.DefaultValues.GetDefaultValuesArray(DefaultValues.java:16)

        at fdrs.FX.DefaultValues.SpotValue(DefaultValues.java:57)

        at fdrs.FX.Main.GenerateDefaultValuesforTables(Main.java:137)

        at fdrs.FX.Main.<init>(Main.java:61)

        at fdrs.MainApplet.init(MainApplet.java:11)

        at sun.applet.AppletPanel.run(AppletPanel.java:424)

        at java.lang.Thread.run(Thread.java:619)


#2
Turk4n

Turk4n

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,847 posts

ld_pvl said:

I'm writing a GUI Applet Application which is going to be run on a server. I have tested the program occasionally and it has been working fine. Lately, I needed to add another function which would allow the program to read some data from a CSV file which is stored in the same folder as my application jar file on the same server.

In my knowledge, applet applications are allowed to read files that are located on the same server. But in my case it does not work. Please help, thank you.

java.security.AccessControlException: access denied (java.io.FilePermission Default.csv read)

        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)

        at java.security.AccessController.checkPermission(AccessController.java:546)

        at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)

        at java.lang.SecurityManager.checkRead(SecurityManager.java:871)

        at java.io.FileInputStream.<init>(FileInputStream.java:100)

        at java.io.FileInputStream.<init>(FileInputStream.java:66)

        at java.io.FileReader.<init>(FileReader.java:41)

        at fdrs.FX.DefaultValues.GetDefaultValuesArray(DefaultValues.java:16)

        at fdrs.FX.DefaultValues.SpotValue(DefaultValues.java:57)

        at fdrs.FX.Main.GenerateDefaultValuesforTables(Main.java:137)

        at fdrs.FX.Main.<init>(Main.java:61)

        at fdrs.MainApplet.init(MainApplet.java:11)

        at sun.applet.AppletPanel.run(AppletPanel.java:424)

        at java.lang.Thread.run(Thread.java:619)

However, not system files or files that has an md5 sum to be check before... I used before make an applet that read in ntldr in WinXP and change values of it. I could read in however I couldn't write it. In your case, your server might request Admin privileges before using files. So I would say try to make a method that reads in Admin privileges and then try to read in the file...
Posted Image