access denied - java.net.SocketPermission
843807May 16 2006 — edited May 19 2006I am very new in Java, installed NetBeans IDE 5 several days ago. So, please, try to explain in simple way :)
I found source of vncclient to access to remote server. And if I load this applet from the same server where I have vnc server everything works correctly. And my task now to access to this remote server from other server. In this case I have responce: "access denied (java.net.SocketPermission [IP address] resolve)".
I created applet.policy file:
grant {
permission java.security.AllPermission;
permission java.net.SocketPermssion "[IP address]:5900","accept,connect,resolve";
permission java.net.SocketPermssion "[IP address]:5800","accept,connect,resolve";
};
and rebuilt project. After I've put to server (to the same folder): all class files, jar file and applet.policy and used index.html:
<HTML>
<TITLE>
VNC desktop
</TITLE>
<APPLET CODE=VncViewer.class ARCHIVE=VncViewer.jar
WIDTH=800 HEIGHT=632>
<param name=PORT value=5900>
<param name=HOST value=http://[IP address]>
</APPLET>
</HTML>
What is my mistake? How should I use applet.policy file?
Thank you in advance!