Two Laptop Bag*
The moose likes JNLP and Web Start and the fly likes java.security.AccessControlException:access denied (java.net.SocketPermission 172.20.68.45:1521 ... 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 172.20.68.45:1521 ..." Watch "java.security.AccessControlException:access denied (java.net.SocketPermission 172.20.68.45:1521 ..." New topic
Author

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

bill zhang
Greenhorn

Joined: Jul 08, 2009
Posts: 8
I have a swing program needs to access db which resides on 172.20.68.45 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 "172.20.68.45", "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 172.20.68.45:1521 connect, resolve.
Can someone tell me why? Thanks.
Vishalkumar srivastava
Greenhorn

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

permission java.net.SocketPermission "172.20.68.45:1521", "listen,accept,connect,resolve";
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2718
    
    6

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


SCJP, SCWCD.
|Asking Good Questions|
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.security.AccessControlException:access denied (java.net.SocketPermission 172.20.68.45:1521 ...