cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using HttpURLConnection class

Former Member
0 Kudos

Hello

I´m building a simple servlet that retrieves Cookies information of a website and displays in the screen. I´m using the following code to retrieve headers:

HttpURLConnection  urlConn;
URL url= new URL ("http://mywebsite");
urlConn = (HttpURLConnection) url.openConnection();	
String testHeader = urlConn.getHeaderField(2);
out.println("Key: " + testHeader);

When I run this code locally, it runs perfectly and fast. When I run on J2EE Server SAP, the getHeaderField line takes about 3 minutes to end. I changed the code to show the current time before and after the "print" of Header. The result is:

Thu, 25-Jun-2009 18:53:21

Key: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8k mod_jk/1.2.28

Thu, 25-Jun-2009 18:56:31

If I take the line of "getHeaderField" off, the program runs fast.

Does anyone have an idea of what´s going on ? I´m using J2EE SAP Server of Netweaver 7.0 (sp13)

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

may be,you will have to go for latest JDK .

you can check http connection test in SICF

Note 554244 - HTTP connection does not function

Note 783515 - Error processing redirects in the HTTP client

Also check SM21 logs on this.

regards

nag