I have an applet embedded in a web page which needs to connect to the host where it has been downloaded. The purpose is retrieving a field from a database, so it invokes a script in the host and it expects to have the data returned
It used to work fine, which is what I would expected from what I have read in every site about applet restrictions: applets are allowed to connect to the host where they have been downloaded
But since one day on, it started to fail. I get the following exception:
java.security.AccessControlException: access denied (java.net.SocketPermission 22.214.171.124:80 connect,resolve)
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)
By tracing the code, I have seen that the exception is yielded in the last call of the following thread:
objurl = new URL(url);
HttpURLConnection conn = (HttpURLConnection)objurl.openConnection();
OutputStream os = conn.getOutputStream();
If someone could give me any hint, it will be greatly appreciated
Thanks in advance
.. have so far managed to ignore two pieces of advice from your first thread that came from someone (e.g. me) who:
<li>Has vast experience with applets.
<li>Will not waste time trying to help people who ignore most of what I say.
Good luck with it.
Note to others who might feel like wasting some time, see also Applet connecting to own host.