java.security.AccessControlException: access denied
(java.lang.RuntimePermission accessClassInPackage.sun.beans.editors)
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.checkPackageAccess(Unknown Source)
at sun.applet.AppletSecurity.checkPackageAccess(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Is this normal or a bug?
I run on Windows XP with JDK 1.5.0_01 .
I first tried to do :
PropertyEditor pe = java.beans.PropertyEditorManager.findEditor(
String.class );
which is the normal way to do it , but I got null .
I answer to myself.
I did this in my application. No need to instanciate
sun.beans.editors.StringEditor, PropertyEditorSupport does the job :
PropertyEditor editor = PropertyEditorManager.findEditor(classs);
// ad-hoc to solve problem running inside an Applet - JDK 1.5.0_01
if ( editor == null && classs == String.class ) {
editor = new PropertyEditorSupport();
}
Note: I did these google searches without results :
- reflection applet development beans troubles
- java security applet class loader