0

I am getting the java.lang.SecurityException: Permission denied: file:////Videos/public/scripts/screenshot.jar when I try to use an applet.

Here is the applet code:

<applet code="Screenshot" archive="file:////Videos/public/scripts/screenshot.jar" width="100px" height="100px">
</applet>

I've signed the applet using this 3-step guide, but it doesn't seem it worked for me, as I am still getting the error. http://www.narendranaidu.com/2007/11/3-easy-steps-to-self-sign-applet-jar.html

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Vadiklk
  • 3,696
  • 5
  • 28
  • 44
  • Its very difficult to tell from the info that you have provided. Are you sure the sign process completed successfully? – Manish Feb 17 '12 at 07:59

1 Answers1

1

Your jar URL looks strange. Personally I have never seen that somebody tries to download applet from URL other than HTTP. Actually it means that your applet will work only for users that are into your LAN where they have access to shared computer named "Videos". Are you sure this is what you want?

The second thing is: try to just copy and paste the JAR URL to your web browser and see what will happen. If you are able to download the jar file directly without entering password this should work when URL is placed into the applet tag. Otherwise it will not. So, first check your URL and fix its problem.

AlexR
  • 114,158
  • 16
  • 130
  • 208
  • *"Personally I have never seen that somebody tries to download applet from URL other than HTTP."* It is part of a bigger problem of putting an absolute path, that should be a relative path. But yes, trying to load the file off the local disks of the end user is unusual (will not work in the real world), and might be causing the strange behavior observed. OP - are you seeing a security prompt to trust the applet? – Andrew Thompson Feb 17 '12 at 08:36
  • I am checking it on my localhost, and it doesn't work even here – Vadiklk Feb 17 '12 at 08:39
  • What is the new applet HTML? Please add it as an edit to the question and notify me of an update. – Andrew Thompson Feb 17 '12 at 17:18