aspose file tools*
The moose likes Java in General and the fly likes java.net.ConnectException help me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "java.net.ConnectException help me" Watch "java.net.ConnectException help me" New topic
Author

java.net.ConnectException help me

Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
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

Joined: Jun 13, 2000
Posts: 3340
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.


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
yes..am behind the firewall..But same Yahoo site I can access through browser..So what might be wrong?

Manohar
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
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
 
 
subject: java.net.ConnectException help me