关于Applet利用数字签名获得本地访问权限的问题

来源:互联网 发布:php eol 有什么用处 编辑:程序博客网 时间:2024/05/16 09:15

太爽了,今天在网上看到一篇关于给jar包加数字签名的文章,很好看啊

正好解决我目前项目中applet抛出的异常的问题

Java Plug-in 1.5.0_11
使用 JRE 版本 1.5.0_11 Java HotSpot(TM) Client VM
用户主目录 = C:/Documents and Settings/Administrator


----------------------------------------------------
c:   清除控制台窗口
f:   终结在结束队列上的对象
g:   垃圾收集
h:   显示此帮助消息
l:   转储类载入程序列表
m:   打印内存使用
o:   触发日志记录
p:   重新载入代理配置
q:   隐藏控制台
r:   重新载入策略配置
s:   转储系统和部署属性
t:   转储线程列表
v:   转储线程堆栈
x:   清除类载入程序高速缓存
0-5: 设置跟踪级别为<n>
----------------------------------------------------

Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
 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.checkMemberAccess(Unknown Source)
 at java.lang.Class.checkMemberAccess(Unknown Source)
 at java.lang.Class.getDeclaredMethod(Unknown Source)
 at org.jfree.chart.urls.URLUtilities.encode(URLUtilities.java:76)
 at org.jfree.chart.urls.StandardPieURLGenerator.generateURL(StandardPieURLGenerator.java:145)
 at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:490)
 at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
 at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JLayeredPane.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
 at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
 at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
 at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
 at java.awt.Container.paint(Unknown Source)
 at sun.awt.RepaintArea.paintComponent(Unknown Source)
 at sun.awt.RepaintArea.paint(Unknown Source)
 at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
 at java.awt.Component.dispatchEventImpl(Unknown Source)
 at java.awt.Container.dispatchEventImpl(Unknown Source)
 at java.awt.Component.dispatchEvent(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
 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.checkMemberAccess(Unknown Source)
 at java.lang.Class.checkMemberAccess(Unknown Source)
 at java.lang.Class.getDeclaredMethod(Unknown Source)
 at org.jfree.chart.urls.URLUtilities.encode(URLUtilities.java:76)
 at org.jfree.chart.urls.StandardPieURLGenerator.generateURL(StandardPieURLGenerator.java:145)
 at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:490)
 at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
 at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JLayeredPane.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
 at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
 at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
 at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
 at java.awt.Container.paint(Unknown Source)
 at sun.awt.RepaintArea.paintComponent(Unknown Source)
 at sun.awt.RepaintArea.paint(Unknown Source)
 at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
 at java.awt.Component.dispatchEventImpl(Unknown Source)
 at java.awt.Container.dispatchEventImpl(Unknown Source)
 at java.awt.Component.dispatchEvent(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
 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.checkMemberAccess(Unknown Source)
 at java.lang.Class.checkMemberAccess(Unknown Source)
 at java.lang.Class.getDeclaredMethod(Unknown Source)
 at org.jfree.chart.urls.URLUtilities.encode(URLUtilities.java:76)
 at org.jfree.chart.urls.StandardPieURLGenerator.generateURL(StandardPieURLGenerator.java:145)
 at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:490)
 at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
 at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JLayeredPane.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
 at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
 at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
 at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
 at java.awt.Container.paint(Unknown Source)
 at sun.awt.RepaintArea.paintComponent(Unknown Source)
 at sun.awt.RepaintArea.paint(Unknown Source)
 at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
 at java.awt.Component.dispatchEventImpl(Unknown Source)
 at java.awt.Container.dispatchEventImpl(Unknown Source)
 at java.awt.Component.dispatchEvent(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
 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.checkMemberAccess(Unknown Source)
 at java.lang.Class.checkMemberAccess(Unknown Source)
 at java.lang.Class.getDeclaredMethod(Unknown Source)
 at org.jfree.chart.urls.URLUtilities.encode(URLUtilities.java:76)
 at org.jfree.chart.urls.StandardPieURLGenerator.generateURL(StandardPieURLGenerator.java:145)
 at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:490)
 at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
 at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JLayeredPane.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
 at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
 at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
 at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
 at java.awt.Container.paint(Unknown Source)
 at sun.awt.RepaintArea.paintComponent(Unknown Source)
 at sun.awt.RepaintArea.paint(Unknown Source)
 at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
 at java.awt.Component.dispatchEventImpl(Unknown Source)
 at java.awt.Container.dispatchEventImpl(Unknown Source)
 at java.awt.Component.dispatchEvent(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
 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.checkMemberAccess(Unknown Source)
 at java.lang.Class.checkMemberAccess(Unknown Source)
 at java.lang.Class.getDeclaredMethod(Unknown Source)
 at org.jfree.chart.urls.URLUtilities.encode(URLUtilities.java:76)
 at org.jfree.chart.urls.StandardPieURLGenerator.generateURL(StandardPieURLGenerator.java:145)
 at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:490)
 at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
 at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
 at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
 at javax.swing.JComponent._paintImmediately(Unknown Source)
 at javax.swing.JComponent.paintImmediately(Unknown Source)
 at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
 at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
 at java.awt.event.InvocationEvent.dispatch(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
 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.checkMemberAccess(Unknown Source)
 at java.lang.Class.checkMemberAccess(Unknown Source)
 at java.lang.Class.getDeclaredMethod(Unknown Source)
 at org.jfree.chart.urls.URLUtilities.encode(URLUtilities.java:76)
 at org.jfree.chart.urls.StandardPieURLGenerator.generateURL(StandardPieURLGenerator.java:145)
 at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:490)
 at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
 at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
 at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
 at javax.swing.JComponent._paintImmediately(Unknown Source)
 at javax.swing.JComponent.paintImmediately(Unknown Source)
 at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
 at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
 at java.awt.event.InvocationEvent.dispatch(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
 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.checkMemberAccess(Unknown Source)
 at java.lang.Class.checkMemberAccess(Unknown Source)
 at java.lang.Class.getDeclaredMethod(Unknown Source)
 at org.jfree.chart.urls.URLUtilities.encode(URLUtilities.java:76)
 at org.jfree.chart.urls.StandardPieURLGenerator.generateURL(StandardPieURLGenerator.java:145)
 at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:490)
 at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
 at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
 at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
 at javax.swing.JComponent._paintImmediately(Unknown Source)
 at javax.swing.JComponent.paintImmediately(Unknown Source)
 at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
 at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
 at java.awt.event.InvocationEvent.dispatch(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
 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.checkMemberAccess(Unknown Source)
 at java.lang.Class.checkMemberAccess(Unknown Source)
 at java.lang.Class.getDeclaredMethod(Unknown Source)
 at org.jfree.chart.urls.URLUtilities.encode(URLUtilities.java:76)
 at org.jfree.chart.urls.StandardPieURLGenerator.generateURL(StandardPieURLGenerator.java:145)
 at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:490)
 at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
 at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
 at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
 at javax.swing.JComponent._paintImmediately(Unknown Source)
 at javax.swing.JComponent.paintImmediately(Unknown Source)
 at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
 at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
 at java.awt.event.InvocationEvent.dispatch(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
 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.checkMemberAccess(Unknown Source)
 at java.lang.Class.checkMemberAccess(Unknown Source)
 at java.lang.Class.getDeclaredMethod(Unknown Source)
 at org.jfree.chart.urls.URLUtilities.encode(URLUtilities.java:76)
 at org.jfree.chart.urls.StandardPieURLGenerator.generateURL(StandardPieURLGenerator.java:145)
 at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:490)
 at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
 at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
 at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
 at javax.swing.JComponent._paintImmediately(Unknown Source)
 at javax.swing.JComponent.paintImmediately(Unknown Source)
 at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
 at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
 at java.awt.event.InvocationEvent.dispatch(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
 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.checkMemberAccess(Unknown Source)
 at java.lang.Class.checkMemberAccess(Unknown Source)
 at java.lang.Class.getDeclaredMethod(Unknown Source)
 at org.jfree.chart.urls.URLUtilities.encode(URLUtilities.java:76)
 at org.jfree.chart.urls.StandardPieURLGenerator.generateURL(StandardPieURLGenerator.java:145)
 at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:490)
 at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
 at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JLayeredPane.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
 at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
 at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
 at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
 at java.awt.Container.paint(Unknown Source)
 at sun.awt.RepaintArea.paintComponent(Unknown Source)
 at sun.awt.RepaintArea.paint(Unknown Source)
 at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
 at java.awt.Component.dispatchEventImpl(Unknown Source)
 at java.awt.Container.dispatchEventImpl(Unknown Source)
 at java.awt.Component.dispatchEvent(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
 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.checkMemberAccess(Unknown Source)
 at java.lang.Class.checkMemberAccess(Unknown Source)
 at java.lang.Class.getDeclaredMethod(Unknown Source)
 at org.jfree.chart.urls.URLUtilities.encode(URLUtilities.java:76)
 at org.jfree.chart.urls.StandardPieURLGenerator.generateURL(StandardPieURLGenerator.java:145)
 at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:490)
 at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
 at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JLayeredPane.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
 at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
 at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
 at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
 at java.awt.Container.paint(Unknown Source)
 at sun.awt.RepaintArea.paintComponent(Unknown Source)
 at sun.awt.RepaintArea.paint(Unknown Source)
 at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
 at java.awt.Component.dispatchEventImpl(Unknown Source)
 at java.awt.Container.dispatchEventImpl(Unknown Source)
 at java.awt.Component.dispatchEvent(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
 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.checkMemberAccess(Unknown Source)
 at java.lang.Class.checkMemberAccess(Unknown Source)
 at java.lang.Class.getDeclaredMethod(Unknown Source)
 at org.jfree.chart.urls.URLUtilities.encode(URLUtilities.java:76)
 at org.jfree.chart.urls.StandardPieURLGenerator.generateURL(StandardPieURLGenerator.java:145)
 at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:490)
 at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
 at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
 at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
 at javax.swing.JComponent._paintImmediately(Unknown Source)
 at javax.swing.JComponent.paintImmediately(Unknown Source)
 at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
 at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
 at java.awt.event.InvocationEvent.dispatch(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-3" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
 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.checkMemberAccess(Unknown Source)
 at java.lang.Class.checkMemberAccess(Unknown Source)
 at java.lang.Class.getDeclaredMethod(Unknown Source)
 at org.jfree.chart.urls.URLUtilities.encode(URLUtilities.java:76)
 at org.jfree.chart.urls.StandardPieURLGenerator.generateURL(StandardPieURLGenerator.java:145)
 at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:490)
 at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
 at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JLayeredPane.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
 at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
 at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
 at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
 at java.awt.Container.paint(Unknown Source)
 at sun.awt.RepaintArea.paintComponent(Unknown Source)
 at sun.awt.RepaintArea.paint(Unknown Source)
 at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
 at java.awt.Component.dispatchEventImpl(Unknown Source)
 at java.awt.Container.dispatchEventImpl(Unknown Source)
 at java.awt.Component.dispatchEvent(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)

原因是由于applet安全机制的问题,需要为引进的jar包签下名
下面将这边文章转载至此 

首先声明,我是个Java初学者,在这里谈一谈Applet和数字签名的问题。

据我所知Applet实现对本地文件进行读写的方法有两种。

1.修改Java_Home/lib/security/java.security文件,并把自己写好的.policy文件放到指定的目录中。

2.对Applet所在的Jar包进行数字签名。

先说说修改Policy文件的方法。这个方法实现起来比较简单,而且只要在.policy文件中进行一定的设置,Applet程序几乎就可以访问本地磁盘里的所有文件了。但是这种方法的一个最大缺点就是要改客户端Jre的java.security文件。在实际应用中,这样的做法不太现实。不可能每个用户为了用你这个Applet去修改自己的安全配置文件,况且很多用户根本不知道Jre是什么。

再说说数字签名的方法,网上也有很多关于数字签名的文章,在这里就不敖述了。大概的方法是:

1、keytool -genkey -keystore someone.store -alias someone  这个命令用来产生一个密匙库,执行完毕后会在当前目录下产生一个soneone.store的文件,这里的someone是我自己写的名字,你可以对它进行修改。另外在执行命令的时候还有提示你输入密匙库的密码,这里你一定要记住,否则后面要用的时候无法输入。
2、给你的Applet打包成jar文件,这个都会吧?jar -cvf ****.jar / .
3、给jar包签名:
  jarsigner -keystore someone.store MyApplet.jar someone
这个命令就是用我们刚刚生成的密钥给jar文件进行签名。

问题来了,是不是只要有了数字签名那Applet就可以在任何情况下读写任何文件呢?好像不是那么回事!
今天就遇到一个问题我写了一个Applet,这个Applet的基本功能是文件的上传和下载。既然是上传就要从本地读文件,下载当然要往本地写文件了。原来用了修改Policy的方法,可以很顺利地实现上传下载。但想想需要每个客户端都要修改Policy不太可行。于是决定用数字签名。

  我用了上述方法给我的Jar包签了名,但是当我上传文件的时候出了问题java.secruity.AccessControlException: access denied (java.io.FilePermission myfile.dat read)
怎么回事?下载文件的时候也是同样的问题。后来终于搞清楚了。

先说说我的页面结构:页面就是一个普通的html静态页面,html页面中嵌入了一个Applet对象和三个<input>按钮分别是《上传》《下载》《关闭》并通过JavaScript来调用Applet中的上传,下载的方法。问题就是出在这里。从Java的安全模型上我们应该不难理解问题的原因了吧。虽然Applet是已经签过名的,但是如果被JavaScript调用并试图访问本地资源,这就违背了Java的安全策略,所以当然会抛异常。
 解决的方法就是让Applet自己独立来完成上述的上传,下载工作。即把页面里的《上传》,《下载》按钮放到Applet里面。问题解决!

第一次写文章,不足之处请多指摘!

原创粉丝点击