jQuery in Action, 3rd edition
The moose likes JNLP and Web Start and the fly likes java.security.AccessControlException:access denied (java.net.SocketPermission ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "java.security.AccessControlException:access denied (java.net.SocketPermission ..." Watch "java.security.AccessControlException:access denied (java.net.SocketPermission ..." New topic

java.security.AccessControlException:access denied (java.net.SocketPermission ...

bill zhang

Joined: Jul 08, 2009
Posts: 8
I have a swing program needs to access db which resides on on port 1521.
I signed the program and policy file looks like:

grant signedBy "susan" {
permission java.io.FilePermission "C:\\Backup\\SignJarTest\\*", "read";
permission java.net.SocketPermission "", "listen,accept,connect,resolve";

If I remove FilePermission from the policy, program throws error on opening a config file. So fist setting solves this problem. However no matter what I do with the second setting for Socket Permission, it keeps giving me error when I run the program:
java.security.AccessControlException:access denied (java.net.SocketPermission connect, resolve.
Can someone tell me why? Thanks.
Vishalkumar srivastava

Joined: Jul 16, 2009
Posts: 2
use the port no. also as shown below

permission java.net.SocketPermission "", "listen,accept,connect,resolve";
Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2846

"Vishal India " please check your private messages. You can check them by clicking the My Private Messages link above.

|Asking Good Questions|
I agree. Here's the link: http://aspose.com/file-tools
subject: java.security.AccessControlException:access denied (java.net.SocketPermission ...
It's not a secret anymore!