• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Signed applets are giving java.net.SocketPermission exception with JRE 8 was fine in JRE 7 or lower

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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, I tested with a java client program from eclipse, this works fine, only with Applet we have issue. may be Applet security need to use full permissions we try with MANIFEST.MF with Permissions: all-permissions and object parameters for applet which doesn't solve the problem.

When we grant in the client machine java.policy to full permissions it was worked fine, but this is not correct way to go ahead forcing to change client machine java.policy.

any help will be appreciated..
Trust God, but always tether your camel... to this tiny ad.
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic