It was working fine with JDK 1.7 or earlier versions, but once we test with JDK 8 we are getting the following exception
Exception in thread "cth" java.security.AccessControlException: access denied ("java.net.SocketPermission" "IP:PORT" "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.SecurityManagerHelper.checkConnectHelper(Unknown Source)
at sun.plugin2.applet.AWTAppletSecurityManager.checkConnect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at iyp.simplegameapplet.d.f.a(Unknown Source)
at iyp.b.a.b$c.run(Unknown Source)
We have an applet, which will open a socket connection to communicate with the server socket application here is the applet code which used to open the socket communication
Socket sock = new Socket();
InputStream is;
OutputStream os;
try {
sock.connect(serverAddr, timeoutMs);
} catch(SocketTimeoutException ex) {
return false;
}
is = sock.getInputStream();
os = sock.getOutputStream();
We are using signed applets. any help will be appreciated...