• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.net.ConnectException help me

 
Manohar Karamballi
Ranch Hand
Posts: 227
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am getting following exception when I tried to retrieve URL connection

Following is exception.

Exception in thread "main" java.net.ConnectException: Operation timed out: conne
ct
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at UCDemo.main(UCDemo.java:11)

Source code is:

Please help me out.

TIA
Manu

---Added Code tags for easier reading - Carl
[ June 07, 2004: Message edited by: Carl Trusiak ]
 
Carl Trusiak
Sheriff
Posts: 3340
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This works fine for me. Are you behind a firewall or Proxy Server? If you are you need to set the ENV variables for the http.proxyHost and http.proxyPort to be able to connect through it.
 
Manohar Karamballi
Ranch Hand
Posts: 227
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes..am behind the firewall..But same Yahoo site I can access through browser..So what might be wrong?

Manohar
 
Carl Trusiak
Sheriff
Posts: 3340
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your browser has the settings for the firewall. On IE, you'll see these under Tools/Internet Options, Select the "Connections" tab Click the "LAN Settings" Button. The setting "Use proxy server for LAN" will be checked. Click the "Advanced" Button.
Under Servers for HTTP, will be listed a server name or IP address and Port Number.

Start the application with
java -Dhttp.proxyHost=<HOST NAME> -Dhttp.proxyPort=<Port Num> UCDemo
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic