Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

System.getProperties() results in java.security.AccessControlException

843833Jun 2 2005 — edited Jun 2 2005
Hi All,

I'm building an web service that needs to make an URL connection.
In order to build the connection, I must set the proxy.

The problem is it seems that I cannot do
Properties Sys=System.getProperties();
since it results in the following exception :

java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)


here is part of my code (part of the implementation of the SEI of my web service)





Properties Sys=System.getProperties();
Sys.put("proxySet","true");
Sys.put("proxyPort","8080");
Sys.put("proxyHost","webcache.singapore.sun.com");




URL url = new URL("http://www.geobytes.com/IpLocator.htm?GetLocation");

URLConnection conn = url.openConnection();
conn.setDoOutput(true);







I'm using SUN App Server 8, my IDE is netbeans 4.1

Any other way in setting the proxy without getting properties from my system? or any work around to make my code working. Please help me, any suggestions are highly appreciated.

Regards,

maggy
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 30 2005
Added on Jun 2 2005
1 comment
148 views