Cannot retrieve the Web document

S

Sid

Hi,

I have been trying to write a stand-alone software for logging into
orkut. I am now trying using the URLConnection. y programme right now
is simple, it justs opens a URLConnection to the address from url and
displays the content to the terminal. I am running the program from
behind the proxy. For this i am using following code:

System.getProperties().put( "proxySet", "true" );
System.getProperties().put( "proxyHost", "192.168.3.254" );
System.getProperties().put( "proxyPort", "8080" );

and for https, i am using :
System.setProperty("java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());

The problem is some pages open using this, but some pages like
www.orkut.com, yahoo.com, geocities.com etc. cannot be opened. I get
the get the proper date from the header but data length i am getting is
-1. I tried the same code for even forums.devshed.com and some others
like redhat.com and it works for them.

Can somebody please tell me whats wrong ? And how i can i correct it ?
 
O

Oliver Wong

Sid said:
Hi,

I have been trying to write a stand-alone software for logging into
orkut. I am now trying using the URLConnection. y programme right now
is simple, it justs opens a URLConnection to the address from url and
displays the content to the terminal. I am running the program from
behind the proxy. For this i am using following code:

System.getProperties().put( "proxySet", "true" );
System.getProperties().put( "proxyHost", "192.168.3.254" );
System.getProperties().put( "proxyPort", "8080" );

and for https, i am using :
System.setProperty("java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());

The problem is some pages open using this, but some pages like
www.orkut.com, yahoo.com, geocities.com etc. cannot be opened. I get
the get the proper date from the header but data length i am getting is
-1. I tried the same code for even forums.devshed.com and some others
like redhat.com and it works for them.

Can somebody please tell me whats wrong ? And how i can i correct it ?

It's not clear what you mean by "some pages [...] cannot be opened."
What happens if you try to open them? Exceptions get thrown? Your computer
turns itself off? Something else?

Content length -1 means the length is not known.

- Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,113
Latest member
Vinay KumarNevatia
Top