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

REGRESSION: Java Plugin throws NullPointerException in followRedirect

XMLWordPrintable

    • rc1
    • x86
    • windows_2000
    • Verified



      Name: gm110360 Date: 12/17/2001


      java version "1.4.0-beta3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
      Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed mode)

      Same exact description as for bug number 4455340 , except this occurs in the
      Java Plugin shipping with JSDK 1.4beta3. I think it's a regression.

      Pasted here for convenience and searchability, except with a new stack trace:

      In Java plugin that ships with JSDK 1.4beta3, if you try to connect to a URL
      that uses both rediretion and cookies, you get a NullPointerException:

      java.lang.NullPointerException
      at sun.net.www.protocol.http.HttpURLConnection.followRedirect
      (HttpURLConnection.java:1053)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream
      (HttpURLConnection.java:650)
      at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream
      (HttpURLConnection.java:298)
      at sun.net.www.protocol.http.HttpURLConnection.getHeaderField
      (HttpURLConnection.java:1092)
      at sun.plugin.net.protocol.http.HttpURLConnection.checkCookieHeader
      (HttpURLConnection.java:276)
      at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream
      (HttpURLConnection.java:296)
      at CookieBug.init(CookieBug.java:10)
      at sun.applet.AppletPanel.run(AppletPanel.java:344)
      at java.lang.Thread.run(Thread.java:539)

      This can be seen with a very simple test case:

      import java.applet.Applet;
      import java.net.*;
      public class CookieBug extends Applet {
          public void init() {
              try {
                  URL u = new URL("http://www.amazon.com/");
                  HttpURLConnection c =
                      (HttpURLConnection)u.openConnection();
                  c.getInputStream();
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }

      Put this class into a signed JAR file (so it has permission to make the URL
      connection) and run it in the plugin, and you will get the above exception.
      You will of course need to have your proxies configured so you can reach the
      URL.

      Release Regression From : merlin-beta
      The above release value was the last known release where this
      bug was knwon to work. Since then there has been a regression.

      (Review ID: 137206)
      ======================================================================

            dgu Dennis Gu (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: