This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 138625

Summary: [Mac] AccessControlException when starting JavaFX Script applet
Product: javafx Reporter: Alexandr Scherbatiy <sunflower>
Component: DeploymentAssignee: Alexey Butenko <alexeybutenko>
Status: VERIFIED WORKSFORME    
Severity: blocker Keywords: RELNOTE
Priority: P2    
Version: 6.x   
Hardware: Macintosh   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

Description Alexandr Scherbatiy 2008-06-30 14:16:12 UTC
Steps to reproduce:
- Create a JavaFX Script file:
-------------------------------------------------
import javafx.application.Application;
import javafx.ext.swing.Canvas;
import javafx.scene.geometry.Ellipse;
import javafx.scene.paint.Color;

Application {
    content: Canvas {
        content: [ 
            Ellipse {
                centerX: 100, centerY: 100
                radiusX: 40, radiusY: 15
                fill: Color.GREEN
            } ]
    }
}
-------------------------------------------------

- Invoke 'Run Applet' from a context menu
  Applet starts
- Go to the project directory, dist folder
 > appletviewer Main.html 

java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.misc)
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
	at java.security.AccessController.checkPermission(AccessController.java:427)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
	at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1512)
	at sun.applet.AppletSecurity.checkPackageAccess(AppletSecurity.java:263)
	at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:116)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:164)
	at com.sun.javafx.runtime.Entry.runtimeProviderLocator(Entry.java:96)
	at com.sun.javafx.runtime.Entry.deferTask(Entry.java:78)
	at com.sun.javafx.runtime.Entry.deferTask(Entry.java:69)
	at javafx.lang.DeferredTask.postInit$(DeferredTask.fx:41)
	at javafx.lang.DeferredTask.initialize$(DeferredTask.fx:33)
	at javafx.application.Applet.init(Applet.fx:78)
	at sun.applet.AppletPanel.run(AppletPanel.java:380)
	at java.lang.Thread.run(Thread.java:613)
Comment 1 Alexei Mokeev 2008-07-09 14:20:14 UTC
From IDE it works. Alexey, please take a look.
Comment 2 Alexey Butenko 2008-07-09 15:34:34 UTC
To get rid of the exception use following command:
>appletviewer -J-Djava.security.policy=../applet.policy Main.html
Comment 3 Alexei Mokeev 2008-07-09 15:38:51 UTC
Worth to document it somewhere. Wiki ?
Comment 4 Alexandr Scherbatiy 2008-07-11 14:21:44 UTC
verified
Comment 5 Alexandr Scherbatiy 2008-07-17 15:40:19 UTC
It is a regression.

The applets  generated from old javafx.gui.Application class run without the AccessControlException:
-------------------------------------------------
import javafx.gui.*;

Application{
    content: Label{ text: "Application content"}
}
-------------------------------------------------

The applets based on new javafx.application.Application class throws the AccessControlException.
Comment 6 Lark Fitzgerald 2008-07-17 16:47:31 UTC
I spoke with pTeam today and this is a known issue that is being release noted for the preview.  If you need this 
feature for preview then we will need to use the old api. SwingFrame, etc.
Comment 7 Lark Fitzgerald 2008-10-31 18:19:49 UTC
No longer reproducible using NBC2 plugin build with SDK 46
Comment 8 Alexandr Scherbatiy 2008-11-01 15:04:33 UTC
verified