io.filepermission: acces denied
Hi everyone,
Im having this problem where I can't seem to be able to "read" images in JPanels and Jbuttons
because they don't seem to have permission to "read" the image.
Did some research but found nothing...
here are the error messages:
Code:
Java Plug-in 1.7.0
Using JRE version 1.7.0-ea-b119 Java HotSpot(TM) Client VM
User home directory = C:\Users\Pete Ravenshard
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
java.security.AccessControlException: access denied ("java.io.FilePermission" "activeIcon.gif" "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 sun.awt.SunToolkit.getImageFromHash(Unknown Source)
at sun.awt.SunToolkit.getImage(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at CustomButton.<init>(CustomButton.java:37)
at MenuPanel.AddAButton(MenuPanel.java:45)
at MenuPanel.<init>(MenuPanel.java:33)
at MaraudersOfDeepSpace.init(maraudersofdeepspace.java:27)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.security.AccessControlException: access denied ("java.io.FilePermission" "activeIcon.gif" "read")
A second one, after removing the activeIcon.gif image (it was an animated gif and I though
maybe the fault would be animation related):
Code:
Java Plug-in 1.7.0
Using JRE version 1.7.0-ea-b119 Java HotSpot(TM) Client VM
User home directory = C:\Users\Pete Ravenshard
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
java.security.AccessControlException: access denied ("java.io.FilePermission" "Earth.png" "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.canRead(Unknown Source)
at javax.imageio.ImageIO.read(Unknown Source)
at MenuPanel.<init>(MenuPanel.java:35)
at MaraudersOfDeepSpace.init(MaraudersOfDeepSpace.java:33)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.security.AccessControlException: access denied ("java.io.FilePermission" "Earth.png" "read")
Thnx in advance,
Resk
Re: io.filepermission: acces denied
Assuming this is an Applet or Webstart app (which is important information), see the following which applies to both:
What Applets Can and Cannot Do (The Java™ Tutorials > Deployment > Java Applets)
Re: io.filepermission: acces denied
Srry Indeed I forgot to mention that im dealing with an applet here...
Ok it seems I need to make my unsigned applet a signed applet
And do it as described in this link:
http://java.sun.com/developer/online...ok/signed.html
is this correct?