Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2005

Tip: Looking for answers? Try searching our database.

Property editor inside an Applet

Thread view: 
Jean-Marc Vanel - 11 Mar 2005 17:52 GMT
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 - 12 Mar 2005 11:02 GMT
> When I attempt to instanciate sun.beans.editors.StringEditor inside an
> Applet I get this :
[quoted text clipped - 11 lines]
>
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.