Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Access Control Exception Error with signed Applet

843789Apr 1 2009 — edited Apr 1 2009
I have a signed applet that is supposed to allow a user to search through their file system via JFileChooser, collect selected files and then transfer a copy of those selected files via HTTP to a server. Currently, the applet allows the user to search and select files but when I try to transfer a copy of the files it throws an error:
java.security.AccessControlException access denied
(java.io.FilePermission C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Blue hills.jpg read)>

I've searched online but everything I've found so far suggests to "sign" the applet - but I've already signed the applet, so that is not the solution to my problem.

Anyone know what the cause of the problem is and what the solution is? When I run the code as an app everything works - searching, collecting selected files, and transferring copy of files.

Below is the exception stack trace:

>
Exception in thread "AWT-EventQueue-2" java.lang.InternalError: couldn't create component peer
at sun.awt.windows.WComponentPeer.checkCreation(Unknown Source)
at sun.awt.windows.WComponentPeer.<init>(Unknown Source)
at sun.awt.windows.WCanvasPeer.<init>(Unknown Source)
at sun.awt.windows.WPanelPeer.<init>(Unknown Source)
at sun.awt.windows.WWindowPeer.<init>(Unknown Source)
at sun.awt.windows.WFramePeer.<init>(Unknown Source)
at sun.awt.windows.WEmbeddedFramePeer.<init>(Unknown Source)
at sun.awt.windows.WToolkit.createEmbeddedFrame(Unknown Source)
at sun.awt.windows.WEmbeddedFrame.addNotify(Unknown Source)
at sun.plugin2.main.client.PluginEmbeddedFrame.addNotify(Unknown Source)
at sun.awt.windows.WEmbeddedFrame.<init>(Unknown Source)
at sun.plugin2.main.client.PluginEmbeddedFrame.<init>(Unknown Source)
at sun.plugin2.main.client.PluginMain$StartAppletRunner.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(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)
java.security.AccessControlException: access denied (java.io.FilePermission C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Blue hills.jpg read)
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.checkRead(Unknown Source)
at java.io.File.isFile(Unknown Source)
at sun.awt.shell.ShellFolder.isFile(Unknown Source)
at org.apache.commons.httpclient.methods.multipart.FilePartSource.<init>(FilePartSource.java:68)
at org.apache.commons.httpclient.methods.multipart.FilePart.<init>(FilePart.java:127)
at projects.web.FilesUploader.postFiles(FilesUploader.java:35)
at projects.web.AppletGUI$ButtonHandler.actionPerformed(AppletGUI.java:170)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(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.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(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.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(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)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2009
Added on Apr 1 2009
9 comments
253 views