On 08/04/2010, Thomas VEQUAUD <[email protected]> wrote: > Hi everybody, > > This is the first time I have to use Java and build an applet for a specific > need : browse images files on a computer and send them on a server in HTP or > FTP. Everything works perfectly fine within NetBeans or AppletViewer but > once embedded in an HTML file... Outch ! I had a first read/write exception > with JFileChooser... I googled it and found an answer: jsigner. So I signed > my .jar and problem solved. But now, I have a new Exception and no answer > about how to fix it so I hope you can get me out of this ! > > Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: > access denied (java.net.SocketPermission ftpperso.free.fr resolve)
Look like the applet does not have "resolve" permission for socket operations. Googling suggests adding something like: permission java.net.SocketPermission "*", "connect, resolve"; to the policy file (you'll need connect after the resolve succeeds). Replace "*" with "ftpperso.free.fr" if you want to restrict the applet to just that host. See: http://java.sun.com/docs/books/tutorial/security/TOC.html for some useful info on permissions etc. I'm surprised that the appletviewer does not show the same problem, but perhaps that has been configured with different permissions from the webserver. > 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.checkConnect(Unknown Source) > at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source) > at java.net.InetAddress.getAllByName0(Unknown Source) > at java.net.InetAddress.getAllByName(Unknown Source) > at java.net.InetAddress.getAllByName(Unknown Source) > at java.net.InetAddress.getByName(Unknown Source) > at java.net.InetSocketAddress.<init>(Unknown Source) > at org.apache.commons.net.SocketClient.connect(SocketClient.java:176) > at > fr.fastimage.uploader.Uploader.uploadButtonActionPerformed(Uploader.java:176) > at fr.fastimage.uploader.Uploader.actionPerformed(Uploader.java:123) > at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) > > Thanks a lot ! In future, please specify the NET version and JVM in case they are relevant. > -- > Thomas VEQUAUD http://thomas.vequaud.free.fr/ > Expert EPITECH en Ingénierie Informatique > Tél : +33(0)6.50.39.28.10 Fax: +33(0)9.58.46.10.07 > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
