标题: 异常一般怎么处理! [打印本页] 作者: joeywr 时间: 2015-8-23 22:49 标题: 异常一般怎么处理! 写的一个Applet小程序,在读入一个图片时,出现了java.security.AccessControlException异常,怎么处理。
Exception in thread "Thread-3" java.security.AccessControlException: access deni
ed ("java.io.FilePermission" "\D:\java\javaAppletExample\ch2\html\Sunset.gif" "r
ead")
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:366)
at java.security.AccessController.checkPermission(AccessController.java:
555)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
at sun.awt.image.URLImageSource.<init>(URLImageSource.java:55)
at sun.applet.AppletImageRef.reconstitute(AppletImageRef.java:51)
at sun.misc.Ref.get(Ref.java:64)
at sun.applet.AppletViewer.getCachedImage(AppletViewer.java:395)
at sun.applet.AppletViewer.getImage(AppletViewer.java:390)
at java.applet.Applet.getImage(Applet.java:274)
at java.applet.Applet.getImage(Applet.java:296)
at Ripple.run(Ripple.java:47)
at java.lang.Thread.run(Thread.java:722)
源程序47行是:
image = getImage(getDocumentBase(),name);