This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Applets and the fly likes getting error when applet try to access some jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "getting error when applet try to access some jar file " Watch "getting error when applet try to access some jar file " New topic
Author

getting error when applet try to access some jar file

anchit pancholi
Ranch Hand

Joined: Oct 14, 2010
Posts: 53
hi all

i am running applet in browser and i am getting error :-


Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission getenv.mywork)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.System.getenv(Unknown Source)
at com.fame.timeiq.license.LicenseCheck$LicenseFileLocation.<init>(SourceFile:828)
at com.fame.timeiq.license.LicenseCheck.l(SourceFile:589)
at com.fame.timeiq.license.LicenseCheck.a(SourceFile:522)
at com.fame.timeiq.license.LicenseCheck.a(SourceFile:370)
at com.fame.timeiq.dates.RegularCalendar.<clinit>(SourceFile:108)

here "mywork" is api and have some classes which are using in my program and i put this jar file in system environment variable also (environment variable name is "mywork")

and i modify java.policy file also :-
permission java.lang.RuntimePermission "getenv.*";
permission java.lang.RuntimePermission "getenv.","*";
permission java.lang.RuntimePermission "*", "read,write";
permission java.lang.PropertyPermission "*", "read,write";

thanks in advance

Cole Terry
Ranch Hand

Joined: Nov 23, 2011
Posts: 45
You need give permission to your applet by signing it with a security certificate.
anchit pancholi
Ranch Hand

Joined: Oct 14, 2010
Posts: 53
Cole Terry wrote:You need give permission to your applet by signing it with a security certificate.


thanks for reply cole

how to do that... could you please help me ..
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Google keywords: "sign applet tutorial".
Nijin puthiya purayil
Ranch Hand

Joined: Nov 09, 2011
Posts: 32
I think this link will help you

http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html#top
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: getting error when applet try to access some jar file
 
Similar Threads
File Uploading Applet
How to get a File object from a InputStream or BufferedReader?
Java 2 Security Problems
applet security exception
Problem Deploying Applet