Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 49415 invoked from network); 26 Nov 2007 13:50:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Nov 2007 13:50:17 -0000 Received: (qmail 3048 invoked by uid 500); 26 Nov 2007 13:50:05 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 2950 invoked by uid 500); 26 Nov 2007 13:50:05 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 2941 invoked by uid 99); 26 Nov 2007 13:50:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Nov 2007 05:50:05 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Nov 2007 13:50:04 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3CA1B71420D for ; Mon, 26 Nov 2007 05:49:43 -0800 (PST) Message-ID: <27365084.1196084983239.JavaMail.jira@brutus> Date: Mon, 26 Nov 2007 05:49:43 -0800 (PST) From: "Tim Ellison (JIRA)" To: commits@harmony.apache.org Subject: [jira] Resolved: (HARMONY-3717) [classlib][luni] java.net.HttpURLConnection.getResponseCode() anomoly In-Reply-To: <475718.1177117815664.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-3717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tim Ellison resolved HARMONY-3717. ---------------------------------- Resolution: Fixed Assignee: Tim Ellison The suggested fix has been committed in the LUNI module at repo revision r598265. Please check that it resolves the issue for you. > [classlib][luni] java.net.HttpURLConnection.getResponseCode() anomoly > --------------------------------------------------------------------- > > Key: HARMONY-3717 > URL: https://issues.apache.org/jira/browse/HARMONY-3717 > Project: Harmony > Issue Type: Bug > Components: App-Oriented Bug Reports, Classlib > Environment: Windows XP SP2 > c:\java\hre50\bin\java -version > svn = r530500, (Apr 20 2007), Windows/ia32/msvc 1310, release build > Reporter: Chris Elford > Assignee: Tim Ellison > Priority: Minor > Attachments: http.java, network.txt > > > I am trying to see if OpenJNLP works with Harmony. OpenJNLP is a pretty old implementation of the JNLP protocol w/o security. I hacked OpenJNLP to recognize Windows XP and then try to load a jnlp app from the the web (http://www.eclipse.org/swt/jws/controlexample.jnlp in this case). It fails with > java.io.IOException: Bad Request > at org.nanode.jnlp.JNLPParser$URLJNLPParser.openInputStream(JNLPParser.java:491) > at org.nanode.jnlp.JNLPParser.parse(JNLPParser.java:119) > at org.nanode.jnlp.JNLPParser.parseDescriptor(JNLPParser.java:292) > at org.nanode.app.openjnlp.DefaultAppHandler.handleOpenURL(Unknown Source) > at org.nanode.app.OpenJNLP.main(Unknown Source) > Launching failed: http://www.eclipse.org/swt/jws/controlexample.jnlp > [It works with the Sun JVM]. > Instrumenting the code shows that the following basic code is executed > URLConnection uc = srcURL.openConnection(); > if (uc instanceof HttpURLConnection) { > HttpURLConnection huc = (HttpURLConnection) uc; > if (huc.getResponseCode() != HttpURLConnection.HTTP_OK) { > throw new IOException(huc.getResponseMessage()); > } > } > getResponseCode() is returning error 400 and thus the app throws the exception. I noted that if I insert a call to huc.getHeaderFields() before the if that checks the response code, I will subsequently get a response 200 (HTTP_OK) and things proceed. It appears like there is some sort of race or deferral in populating the response codes here. Note that instead of calling huc.getHeaderFields(), I tried putting a 5 sec sleep in and it did NOT fix it. It doesn't look like it is a normal race. > Note that it works with the Sun VM without any mods at all. > Note that I am using a proxy server via -Dproxyset=true -DproxyHost=xxx -DproxyPort=yyy at the java command line. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.