Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Property editor inside an Applet

0 views
Skip to first unread message

Jean-Marc Vanel

unread,
Mar 11, 2005, 12:52:30 PM3/11/05
to
When I attempt to instanciate sun.beans.editors.StringEditor inside an
Applet I get this :

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 .

Jean-Marc Vanel

unread,
Mar 12, 2005, 6:02:55 AM3/12/05
to
Jean-Marc Vanel wrote:
> When I attempt to instanciate sun.beans.editors.StringEditor inside an
> Applet I get this :
>
> java.security.AccessControlException: access denied
> (java.lang.RuntimePermission accessClassInPackage.sun.beans.editors)
> at java.security.AccessControlContext.checkPermission(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


0 new messages