File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes java.lang.RuntimePermission getClassLoader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "java.lang.RuntimePermission getClassLoader" Watch "java.lang.RuntimePermission getClassLoader" New topic
Author

java.lang.RuntimePermission getClassLoader

Surya Kant
Ranch Hand

Joined: Mar 29, 2005
Posts: 104
I have one web application where i am using applet.The following exception is thrown in console & applet is not loading.
This issue is not frequent.Once in a month i get this.Does any one know about this problem?



java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
at com.company.team.report.condition.QuickApplet.init(QuickApplet.java:58)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source) ???java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
at com.company.team.report.condition.QuickApplet.init(QuickApplet.java:58)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source) ???java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42956
    
  73
Dealing with ClassLoaders is one of the things applets are forbidden to do in their security sandbox. See HowCanAnAppletReadFilesOnTheLocalFileSystem on how to get around that.
Surya Kant
Ranch Hand

Joined: Mar 29, 2005
Posts: 104
Hi
I have taken care all these aspects and it is working fine also.But why only sometimes it fails?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.RuntimePermission getClassLoader
 
It's not a secret anymore!