Skip to Main Content

Java APIs

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!

access denied java.net.SocketPermission connect,resolve

843790Jun 12 2006 — edited Jan 29 2009
Hello,

I am having a problem connecting to a proxy server in order to return an RSS feed. I am using GoDaddy as my hosting service, they require connecting to a proxy server before making any outgoing requests. The Tomcat version is 5.0.27. They have a PHP script that uses CURL to do this, I have tested that and it works fine.

http://help.godaddy.com/article.php?article_id=288&topic_id=&&

Here is my code and the error:
SocketAddress addr = new InetSocketAddress("64.202.165.130", 3128);
Proxy proxy = new Proxy(Proxy.Type.HTTP, addr);
    	
 try  {
  URL url = new URL(fileSpec);
  URLConnection conn = url.openConnection(proxy);
  conn.connect(); 
  conn.setConnectTimeout(120);
  InputStream xmlStr = conn.getInputStream();
}  catch (MalformedURLException mue) {
....
} catch (IOException ioe) {
...
}
ERROR:
Failed to read news "http://newsrss.bbc.co.uk/rss/newsonline_world_edition/latest_published_stories/rss.xml" : Error parsing RSS feed : access denied (java.net.SocketPermission newsrss.bbc.co.uk:80 connect,resolve)


Any help would be appreciated.

Message was edited by:
carli1

Message was edited by:
carli1
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 26 2009
Added on Jun 12 2006
8 comments
1,496 views