wood burning stoves*
The moose likes Java in General and the fly likes Why does Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Why does "connnection timed out" appear when trying to read remote xml file." Watch "Why does "connnection timed out" appear when trying to read remote xml file." New topic
Author

Why does "connnection timed out" appear when trying to read remote xml file.

Anupam Bhatt
Ranch Hand

Joined: Mar 12, 2004
Posts: 81
Hi All

I am facing this problem:
"when i try to read a remote xml file into a input stream [to be read and processed further] it says "connection timed out" . Alhough the same url works fine when i give it in the browser address bar.



The statement marked with ">>>" throws this error.

Any help will be appreciated.

Thanks,
Anupam Bhatt
Harald Kirsch
Ranch Hand

Joined: Oct 14, 2005
Posts: 37
Proxy?


Harald.
Anupam Bhatt
Ranch Hand

Joined: Mar 12, 2004
Posts: 81
Originally posted by Harald Kirsch:
Proxy?


yeah behind a proxy but i have run small programs and tested that my programs get through the proxy easily.
So itz ruled out if there is a proxy blocking the data coming to inputstream.

Thanks for the reply Harald
Anupam Bhatt
Ranch Hand

Joined: Mar 12, 2004
Posts: 81
does inputstream connect at some particular port or in the default http port[80]?
Any help in this regard will be appreciated.

Thanks,
Anupam Bhatt
Ashu Shinde
Greenhorn

Joined: Nov 11, 2005
Posts: 1
Hi anupam,

Did you try setting the Proxy Ip and the port explicitly using either the System property in the code or the -D option?

System.setProperty( "proxySet", "true" );
System.setProperty( "http.proxyHost", proxyHostName );
System.setProperty( "http.proxyPort", Integer.toString( proxyHostPort ) );

-- Ashutosh
Anupam Bhatt
Ranch Hand

Joined: Mar 12, 2004
Posts: 81
Originally posted by Ashu Shinde:
Hi anupam,

Did you try setting the Proxy Ip and the port explicitly using either the System property in the code or the -D option?

System.setProperty( "proxySet", "true" );
System.setProperty( "http.proxyHost", proxyHostName );
System.setProperty( "http.proxyPort", Integer.toString( proxyHostPort ) );

-- Ashutosh


Hi Ashutosh,

Thanks for your reply. It has been helpfull for sure.
but still i get "server redirected too many times" error now.
Is there a method to authenticate from the code to the proxy ?

As always any help will be appreciated.

Thanks,
Anupam Bhatt
Anupam Bhatt
Ranch Hand

Joined: Mar 12, 2004
Posts: 81
Thanks Guyz,
I was finally able to authenticate to the proxy and get the inputstream for the xml smoothly.

Thanks for the help
Anupam Bhatt
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Why does "connnection timed out" appear when trying to read remote xml file.