Hi, I'm having a rather interesting problem.
I have an applet that uses org.apache.commons.net.ftp.FTPClient to get a list of files in a folder on an online directory.
When I run it on my local machine (contacting the external server), it works flawlessly. However, when I embedded the applet on the server in an html page and attempted to run the applet, I received the following exception:
Anyone have any thoughts? I find it extremely suspicious that it works while in my development environment (Springsource) but not on the server. Furthermore, all of the rest of my ftp calls (which do not use apache) work perfectly.
java.security.AccessControlException: access denied (java.util.PropertyPermission org.apache.commons.net.ftp.systemType read)
at java.security.AccessControlContext.checkPermission (Unknown Source)
at java.security.AccessController.checkPermission(Unk nown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unkn own Source)
at java.lang.System.getProperty(Unknown Source)
at org.apache.commons.net.ftp.FTPClient.initiateListP arsing(FTPClient.java:3055)
at org.apache.commons.net.ftp.FTPClient.listFiles(FTP Client.java:2731)
at org.apache.commons.net.ftp.FTPClient.listFiles(FTP Client.java:2778)
at airline.Connection.HttpCommunication.readCompanyNa meList(HttpCommunication.java:54)
at airline.UserApplet.AirlineGameApplet$1.run(Airline GameApplet.java:109)
at java.lang.Thread.run(Unknown Source)
Is the applet signed? FTPClient relies on a Socket to connect to the remote server, which is a network connection and not allowed without Security access. The security restrictions don't typically apply in a development environment - hence the difference in behavior
See What Applets Can and Cannot Do (The Java™ Tutorials > Deployment > Java Applets)
The following post helped me a lot the first time I tried to sign an applet:
So, I started to try to do what was suggested in the link. I got to where it asks me to "Enter keystore password:", but the console won't let me type anything. I tried just pressing enter, and it then prompted me to "Re-enter new password:". Any thoughts?
If I remember correctly, it does let you type - its a password, and thus hidden from view
The cursor wasn't moving when I was typing... I was running it as Administrator, so I'm pretty sure I gave it the best possible situation.
Originally Posted by aussiemcgr
Did you type in your password when prompted, and do it again when prompted to retype? It will not display what you type, as you type, for passwords - this is a common security measure for command line utilities such as this.
If you are still stuck with signing applet issue, this can be of help: How to sign a Java applet
This thread is 6 months old!
I notice from copeg, yesterday - "Please don't resurrect posts over a year old, especially with the intent of providing links back to (what I presume is) your webpage for self promotion". I know it's the season of goodwill and all that, but please stop doing this: it's bl00dy annoying.