-
Security with applet ?
I got that message :
java.security.AccessControlException: access denied (java.io.FilePermission d:\temp\classe1.java read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
at java.lang.SecurityManager.checkRead(SecurityManager.java:887)
at java.io.File.length(File.java:790)
at applet1.actionOuvrirFichier(applet1.java:221)
at applet1.actionLoginButton(applet1.java:209)
at applet1.actionPerformed(applet1.java:202)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1767)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1820)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:258)
at java.awt.Component.processMouseEvent(Component.java:5021)
at java.awt.Component.processEvent(Component.java:4818)
at java.awt.Container.processEvent(Container.java:1380)
at java.awt.Component.dispatchEventImpl(Component.java:3526)
at java.awt.Container.dispatchEventImpl(Container.java:1437)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3214)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2929)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2859)
at java.awt.Container.dispatchEventImpl(Container.java:1423)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
------------------------------------------------------
Anyone can tell me how to solve that problem ? I have that only when in internet explorer, inside the JBuilder all is ok :(
-
I didn't think you could do file I/O with applets. Is that where the error occurs?
-
I get that error when I push the button to open the file :(
-
i believe you are having a problem with the security manager. to prevent malicious applet for ****ing your computer, applets are restricted in their behaviour. what an applet can or canot do is determine by the "priveleges" (i trhink thats what it is called) an applet is awarded, you can probably give rights to the applet throguh some of the options in IE or something. JBuilder probably doesn't bother (ie. bypasses) with the security manager stuff b/c it assumes no moron would compile and run malicous code on their own box. :D
-
You need to look into digitally signing your JAR file.
Sun's page here http://developer.java.sun.com/develo...n/signing.html