Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6199693

Missing port for proxy server in Internet Options causes problems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0
    • deploy

      FULL PRODUCT VERSION :
      java version "1.5.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
      Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      With Java Control Panel > Network Settings > Use browser settings set, the JRE takes its proxy settings from Internet Options > Connections > LAN Settings > Proxy server. Normally, it is possible to leave the port blank and it will default to 80 (the default HTTP port) for HTTP transactions. This happens in general in Windows and in J2SE 1.4.2.

      In JDK 1.5.0, this defaulting behaviour has gone away. This results in an exception as given below. The exception causes the load to be attempted direct to the appropriate machine, bypassing the proxy (which in my case succeeds). I presume that if the proxy were required, then the load would fail.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Download a file using URL.openStream() or Toolkit.createImage(URL) using a URL that should go through the proxy, with the system settings as detailed above. The exception will appear on the Java Console.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expect the port to default to 80, and therefore the load to succeed.

      ACTUAL -
      Exception and direct communication as detailed above.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.IllegalArgumentException: port out of range:-1
      at java.net.InetSocketAddress.<init>(Unknown Source)
      at com.sun.deploy.net.proxy.DeployProxySelector$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.deploy.net.proxy.DeployProxySelector.select(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
      at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
      at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
      at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
      at sun.awt.image.ImageFetcher.run(Unknown Source)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Fill in the port number in Internet Options.

            pallenba Peter Allenbach (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: