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

Regression: Redirection stopped working in 1.2.2_007 and 1.3.0_02

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.3.0_02
    • deploy
    • generic
    • generic



      Name: boT120536 Date: 03/15/2001


      java version "1.3.0_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_02)
      Java HotSpot(TM) Client VM (build 1.3.0_02, mixed mode)

      Our system is using the RedirectMatch in our Apache Web Server to redirect
      cgi-bin command to other sites. This is working in well in 1.2.2_006 and
      1.3.0-C but when tried in 1.3.0_02 and 1.2.2_007 the cgi-bin request stopped
      working and gave the following error.

       java.lang.NullPointerException
      at sun.net.www.protocol.http.HttpURLConnection.followRedirect(Unknown
      Source)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
      Source)
      at
      sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown
      Source)
      at
      sun.plugin.protocol.jdk12.http.HttpURLConnection.checkCookieHeader(Unknown
      Source)
      at
      sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
      at java.net.HttpURLConnection.getResponseCode(Unknown Source)
      at java.net.HttpURLConnection.getResponseMessage(Unknown Source)
      at nettest.Nettest.starttest(Nettest.java:34)
      at nettest.Nettest.init(Nettest.java:19)
      at sun.applet.AppletPanel.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

      The code to produce the results is as follows.

      package nettest;
      import javax.swing.*;
      import javax.swing.filechooser.*;
      import javax.swing.event.*;
      import java.lang.*;
      import java.io.*;
      import java.net.*;
      import java.awt.event.*;

      public class Nettest extends JApplet {
          public Nettest() {
      super();
          }

          public void init() {
      super.init();
      String url = JOptionPane.showInputDialog(getContentPane(),"Start test?");
      System.out.println("url = " + url);

      starttest("TRUSTEDHOST.hpl1.cb.lucent.com:8811/html/lucent/fm/dataservices/cgi-bin/DataSourceServices/dataSourceNameList?userId=bhavanas");
          }
          public void starttest(String url) {
      String cbase = this.getCodeBase().toString();
      String errStr = "";

           HttpURLConnection uc = null;
           try {
                 URL whereto = new URL( cbase + url );
      uc = (HttpURLConnection)whereto.openConnection();
      InputStream in = uc.getInputStream();
      } catch(NullPointerException n) {
      n.printStackTrace();
      } catch ( IOException ioe) {
      try {
      if(uc != null) {
      errStr += uc.getResponseMessage();
      } else {
      errStr += ioe.toString();
      }
      System.out.println(errStr);
      } catch ( IOException ex) {
      errStr = "DataService Failure: ";
      errStr += ioe.toString();
      System.out.println(errStr);
      }
      }
          }
      }

      The problem is independent of browser or client platform.
      (Review ID: 118880)
      ======================================================================

            hdongorcl Hao Dong (Inactive)
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: