File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Reg:Socket security exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Reg:Socket security exception" Watch "Reg:Socket security exception" New topic

Reg:Socket security exception

rajesh anguraj

Joined: Feb 06, 2008
Posts: 15
Dear all,

I've written an applet running in a webpage, which will open a socket connecting to, the localhost.

It work fine in my development environment (browser & webserver run in localhost), but when I deploy the website to a server,the applet always run with exception "access denied ( connect,resolve)".

I've have signed the jar with a cert. I have changed the java.policy in system to allow it, but still it didnt work.

The grant permission that i gave is :

kindly provide me a solution.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
If the applet is signed then no policy change is needed - those are two different ways to accomplish the same thing. Are you getting the dialog that asks you whether you want to trust the certificate?

You may have to run the code as privileged code, as described in
rajesh anguraj

Joined: Feb 06, 2008
Posts: 15
I am getting the dialog for trust certificate. The problem is i am calling the applet method through a javascript call. I feel this might be causing the problem.
I agree. Here's the link:
subject: Reg:Socket security exception
jQuery in Action, 3rd edition