I have this problem with Firefox and Camino, with an applet including a JMenuBar, a JTextPane inside a JScrollPane, and a JLabel. I'm using the latest (stable) versions of everything.
When the applet loads, I get this error in the Java Console (in a method called by javascript, doing the initialisation after the init() method has been called):
MyCPanel getGraphics(): exception: access denied (java.lang.RuntimePermission accessClassInPackage.apple.awt)
java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.apple.awt)
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:190)
at netscape.oji.JNIUtils.checkClassAccess(JNIUtils.java:105)
at netscape.oji.JNIUtils.checkClassAccess(JNIUtils.java:67)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
at java.lang.Class.getMethod0(Class.java:2611)
at java.lang.Class.getMethod(Class.java:1579)
at apple.awt.MyCPanel.getGraphics(MyCPanel.java:111)
at java.awt.Component.getGraphics(Component.java:2475)
at java.awt.Component.getGraphics(Component.java:2463)
at javax.swing.JComponent.getGraphics(JComponent.java:1913)
at java.awt.Component.getGraphics(Component.java:2463)
at javax.swing.JComponent.getGraphics(JComponent.java:1913)
at java.awt.Component.getGraphics(Component.java:2463)
at javax.swing.JComponent.getGraphics(JComponent.java:1913)
at java.awt.Component.getGraphics(Component.java:2463)
at javax.swing.JComponent.getGraphics(JComponent.java:1913)
at java.awt.Component.getGraphics(Component.java:2463)
at javax.swing.JComponent.getGraphics(JComponent.java:1913)
at java.awt.Component.getFontMetrics(Component.java:2512)
at javax.swing.JComponent.getFontMetrics(JComponent.java:1580)
at javax.swing.text.GlyphPainter1.sync(GlyphPainter1.java:198)
at javax.swing.text.GlyphPainter1.getSpan(GlyphPainter1.java:42)
at javax.swing.text.GlyphView.getPreferredSpan(GlyphView.java:536)
at javax.swing.text.FlowView$LogicalView.getPreferredSpan(FlowView.java:689)
at javax.swing.text.FlowView.calculateMinorAxisRequirements(FlowView.java:216)
at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:542)
at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:879)
at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:325)
at javax.swing.text.BoxView.layout(BoxView.java:682)
at javax.swing.text.BoxView.setSize(BoxView.java:379)
at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1619)
at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(BasicTextUI.java:818)
at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
at javax.swing.JEditorPane.getPreferredSize(JEditorPane.java:1227)
at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:769)
at java.awt.Container.layout(Container.java:1401)
at java.awt.Container.doLayout(Container.java:1390)
at java.awt.Container.validateTree(Container.java:1473)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validate(Container.java:1448)
It looks like there's a security problem in MyCPanel.getGraphics. Is this the same MyCPanel class that's in JEP, even though it's in the apple.awt package ?
After that, the applet finishes loading, everything else works fine except that I can't enter any text in the JTextPane. When a dialog opens, I can type text there, but after that I still can't type anything in the JTextPane...
For the record, I get a different bug when I try Java 1.4.2 instead of Java 1.5.0:
apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: java/lang/StringBuilder
java.lang.NoClassDefFoundError: java/lang/StringBuilder
at apple.awt.MyCAppletFrame142Tiger.getGraphics(MyCAppletFrame142Tiger.java:134)
at java.awt.Component.getGraphics(Component.java:2153)
at sun.awt.RepaintArea.paint(RepaintArea.java:165)
at apple.awt.ComponentModel.handleEvent(ComponentModel.java:290)
at apple.awt.MyCAppletFrame142Tiger.handleEvent(MyCAppletFrame142Tiger.java:117)
at java.awt.Component.dispatchEventImpl(Component.java:3744)
at java.awt.Container.dispatchEventImpl(Container.java:1671)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3543)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
LiveConnect event dispatcher caught exception: java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at jep.LiveConnect$DoProxy.run(LiveConnect.java:104)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:189)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:478)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Caused by: java.lang.ExceptionInInitializerError
at java.awt.datatransfer.SystemFlavorMap.parseAndStoreReader(SystemFlavorMap.java:327)
at java.awt.datatransfer.SystemFlavorMap.<init>(SystemFlavorMap.java:209)
at java.awt.datatransfer.SystemFlavorMap.getDefaultFlavorMap(SystemFlavorMap.java:147)
at java.awt.dnd.DropTarget.<init>(DropTarget.java:805)
at java.awt.dnd.DropTarget.<init>(DropTarget.java:131)
at javax.swing.TransferHandler$SwingDropTarget.<init>(TransferHandler.java:531)
at javax.swing.JComponent.setTransferHandler(JComponent.java:2774)
at javax.swing.plaf.basic.BasicTextUI.installDefaults(BasicTextUI.java:278)
at apple.laf.AquaTextPaneUI.installDefaults(AquaTextPaneUI.java:65)
at javax.swing.plaf.basic.BasicTextUI.installUI(BasicTextUI.java:675)
at javax.swing.plaf.basic.BasicTextPaneUI.installUI(BasicTextPaneUI.java:64)
at javax.swing.JComponent.setUI(JComponent.java:449)
at javax.swing.text.JTextComponent.setUI(JTextComponent.java:287)
at javax.swing.text.JTextComponent.updateUI(JTextComponent.java:297)
at javax.swing.text.JTextComponent.<init>(JTextComponent.java:271)
at javax.swing.JEditorPane.<init>(JEditorPane.java:175)
at javax.swing.JTextPane.<init>(JTextPane.java:71)
...
at netscape.oji.JNIRunnable.run(Native Method)
at netscape.oji.LiveConnectProxy.run(LiveConnectProxy.java:48)
... 11 more
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.awt.datatransfer)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1491)
at sun.applet.AppletSecurity.checkPackageAccess(AppletSecurity.java:190)
at netscape.oji.JNIUtils.checkClassAccess(JNIUtils.java:105)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at sun.awt.datatransfer.DataTransferer.class$(DataTransferer.java:124)
at sun.awt.datatransfer.DataTransferer.<clinit>(DataTransferer.java:123)
... 33 more
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You need to give me a URL at which I can access your applet, or write a test
case that demonstrates this problem and give me the URL to that, or open a bug
at the Java Embedding Plugin's Bugs Tracker and attach the Java source code
for a test case there.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried Firefox 1.5.0.4, and I think the first 2 bugs are fixed. Thanks. My applet is still impossible to use, though, because of the 3rd bug (I can't type any text in the JTextPane).
There is currently no open bug in the tracker for this problem, shouldn't we open a new one, or re-open the one I created and that you closed ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have this problem with Firefox and Camino, with an applet including a JMenuBar, a JTextPane inside a JScrollPane, and a JLabel. I'm using the latest (stable) versions of everything.
When the applet loads, I get this error in the Java Console (in a method called by javascript, doing the initialisation after the init() method has been called):
MyCPanel getGraphics(): exception: access denied (java.lang.RuntimePermission accessClassInPackage.apple.awt)
java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.apple.awt)
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:190)
at netscape.oji.JNIUtils.checkClassAccess(JNIUtils.java:105)
at netscape.oji.JNIUtils.checkClassAccess(JNIUtils.java:67)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
at java.lang.Class.getMethod0(Class.java:2611)
at java.lang.Class.getMethod(Class.java:1579)
at apple.awt.MyCPanel.getGraphics(MyCPanel.java:111)
at java.awt.Component.getGraphics(Component.java:2475)
at java.awt.Component.getGraphics(Component.java:2463)
at javax.swing.JComponent.getGraphics(JComponent.java:1913)
at java.awt.Component.getGraphics(Component.java:2463)
at javax.swing.JComponent.getGraphics(JComponent.java:1913)
at java.awt.Component.getGraphics(Component.java:2463)
at javax.swing.JComponent.getGraphics(JComponent.java:1913)
at java.awt.Component.getGraphics(Component.java:2463)
at javax.swing.JComponent.getGraphics(JComponent.java:1913)
at java.awt.Component.getGraphics(Component.java:2463)
at javax.swing.JComponent.getGraphics(JComponent.java:1913)
at java.awt.Component.getFontMetrics(Component.java:2512)
at javax.swing.JComponent.getFontMetrics(JComponent.java:1580)
at javax.swing.text.GlyphPainter1.sync(GlyphPainter1.java:198)
at javax.swing.text.GlyphPainter1.getSpan(GlyphPainter1.java:42)
at javax.swing.text.GlyphView.getPreferredSpan(GlyphView.java:536)
at javax.swing.text.FlowView$LogicalView.getPreferredSpan(FlowView.java:689)
at javax.swing.text.FlowView.calculateMinorAxisRequirements(FlowView.java:216)
at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:542)
at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:879)
at javax.swing.text.BoxView.checkRequests(BoxView.java:911)
at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:325)
at javax.swing.text.BoxView.layout(BoxView.java:682)
at javax.swing.text.BoxView.setSize(BoxView.java:379)
at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1619)
at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(BasicTextUI.java:818)
at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
at javax.swing.JEditorPane.getPreferredSize(JEditorPane.java:1227)
at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:769)
at java.awt.Container.layout(Container.java:1401)
at java.awt.Container.doLayout(Container.java:1390)
at java.awt.Container.validateTree(Container.java:1473)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validateTree(Container.java:1480)
at java.awt.Container.validate(Container.java:1448)
It looks like there's a security problem in MyCPanel.getGraphics. Is this the same MyCPanel class that's in JEP, even though it's in the apple.awt package ?
After that, the applet finishes loading, everything else works fine except that I can't enter any text in the JTextPane. When a dialog opens, I can type text there, but after that I still can't type anything in the JTextPane...
For the record, I get a different bug when I try Java 1.4.2 instead of Java 1.5.0:
apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: java/lang/StringBuilder
java.lang.NoClassDefFoundError: java/lang/StringBuilder
at apple.awt.MyCAppletFrame142Tiger.getGraphics(MyCAppletFrame142Tiger.java:134)
at java.awt.Component.getGraphics(Component.java:2153)
at sun.awt.RepaintArea.paint(RepaintArea.java:165)
at apple.awt.ComponentModel.handleEvent(ComponentModel.java:290)
at apple.awt.MyCAppletFrame142Tiger.handleEvent(MyCAppletFrame142Tiger.java:117)
at java.awt.Component.dispatchEventImpl(Component.java:3744)
at java.awt.Container.dispatchEventImpl(Container.java:1671)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3543)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
LiveConnect event dispatcher caught exception: java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at jep.LiveConnect$DoProxy.run(LiveConnect.java:104)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:189)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:478)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Caused by: java.lang.ExceptionInInitializerError
at java.awt.datatransfer.SystemFlavorMap.parseAndStoreReader(SystemFlavorMap.java:327)
at java.awt.datatransfer.SystemFlavorMap.<init>(SystemFlavorMap.java:209)
at java.awt.datatransfer.SystemFlavorMap.getDefaultFlavorMap(SystemFlavorMap.java:147)
at java.awt.dnd.DropTarget.<init>(DropTarget.java:805)
at java.awt.dnd.DropTarget.<init>(DropTarget.java:131)
at javax.swing.TransferHandler$SwingDropTarget.<init>(TransferHandler.java:531)
at javax.swing.JComponent.setTransferHandler(JComponent.java:2774)
at javax.swing.plaf.basic.BasicTextUI.installDefaults(BasicTextUI.java:278)
at apple.laf.AquaTextPaneUI.installDefaults(AquaTextPaneUI.java:65)
at javax.swing.plaf.basic.BasicTextUI.installUI(BasicTextUI.java:675)
at javax.swing.plaf.basic.BasicTextPaneUI.installUI(BasicTextPaneUI.java:64)
at javax.swing.JComponent.setUI(JComponent.java:449)
at javax.swing.text.JTextComponent.setUI(JTextComponent.java:287)
at javax.swing.text.JTextComponent.updateUI(JTextComponent.java:297)
at javax.swing.text.JTextComponent.<init>(JTextComponent.java:271)
at javax.swing.JEditorPane.<init>(JEditorPane.java:175)
at javax.swing.JTextPane.<init>(JTextPane.java:71)
...
at netscape.oji.JNIRunnable.run(Native Method)
at netscape.oji.LiveConnectProxy.run(LiveConnectProxy.java:48)
... 11 more
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.awt.datatransfer)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1491)
at sun.applet.AppletSecurity.checkPackageAccess(AppletSecurity.java:190)
at netscape.oji.JNIUtils.checkClassAccess(JNIUtils.java:105)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at sun.awt.datatransfer.DataTransferer.class$(DataTransferer.java:124)
at sun.awt.datatransfer.DataTransferer.<clinit>(DataTransferer.java:123)
... 33 more
You need to give me a URL at which I can access your applet, or write a test
case that demonstrates this problem and give me the URL to that, or open a bug
at the Java Embedding Plugin's Bugs Tracker and attach the Java source code
for a test case there.
here you go :
http://sourceforge.net/tracker/index.php?func=detail&aid=1433659&group_id=107955&atid=649116
I tried Firefox 1.5.0.4, and I think the first 2 bugs are fixed. Thanks. My applet is still impossible to use, though, because of the 3rd bug (I can't type any text in the JTextPane).
There is currently no open bug in the tracker for this problem, shouldn't we open a new one, or re-open the one I created and that you closed ?
I suggest you open a new one, and I'll take a look at it.