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

file url's seem broken in jdk1.1.7E for win95/nt

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P1 P1
    • None
    • 1.1.7
    • core-libs
    • x86
    • generic

      File URL's seem to be broken under JDK1.1.7E for win95/nt, the following
      test cases work fine under JDK1.1.6. Please note that 1.1.7E was used to
      test for resolution to printing problems with the HJBean 1.1.2 at which point we noticed the file url problems.

      JDK 1.1.6 testing

      c1: java TestPrinting file:\\C:\printing\index.html


      c2: java -Dhttp.proxyPort=8080 -Dhttp.proxyHost=192.168.2.2 TestPrinting
      http://www.cnn.com/






      Using jdk 1.1.6 both c1 and c2 commands work fine and bring up the url in
      HotJavaBean.
      But the Printing does not work and the error that it produces is as follows.



      JDK1.1.7E


      Using jdk 1.1.7 neither c1 nor c2 command brings up any URL. But whatever
      the error message
      I see in the HotJavaBean I can print, with the exception of graphic printing
      being poor.

      c1 produces the following error message

      C:\Printing>java TestPrinting file:\\C:\printing\index.html
      [Loaded DTD html32 in 390ms]
      MimeTable.load: file = C:\JDK1.1.7\BIN\..\lib\content-types.properties,
      java.io.
      FileNotFoundException: C:\JDK1.1.7\BIN\..\lib\content-types.properties
      java.io.FileNotFoundException:
      C:\JDK1.1.7\BIN\..\lib\content-types.properties
              at java.io.FileInputStream.<init>(FileInputStream.java:56)
              at java.io.FileInputStream.<init>(FileInputStream.java:75)
              at sun.net.www.MimeTable.load(MimeTable.java:212)
              at sun.net.www.MimeTable.&lt;init&gt;(MimeTable.java:43)
              at sun.net.www.MimeTable.getDefaultTable(MimeTable.java:52)
              at sunw.hotjava.doc.DocParser.run(Compiled Code)
              at java.lang.Thread.run(Thread.java:466)
      java.lang.NullPointerException
              at sunw.hotjava.doc.DocParser.run(Compiled Code)
              at java.lang.Thread.run(Thread.java:466)




      TestPrinting.java


      import java.awt.*;
      import java.awt.event.*;

      import sunw.hotjava.bean.*;

      public class TestPrinting
      {
      private HotJavaBrowserBean bean_;
      private HotJavaDocumentStack docStack_;

      private Button backButton_, printButton_, closeButton_;

      public static void main(String[] argv)
      {
      if(argv.length == 0)
      {
      System.out.println("");
      System.out.println("\tUsage: java TestPrinting url");
      System.out.println("");
      System.exit(-1);
      }
      new TestPrinting(argv[0]);
      }

      public TestPrinting(String url)
      {
      Frame f = new Frame("Test1");
      f.setLayout(new BorderLayout());

      bean_ = new HotJavaBrowserBean();
      docStack_ = new HotJavaDocumentStack();

      docStack_.addBrowserHistoryListener(bean_);

      Panel p = new Panel();
      p.setLayout(new GridLayout(1, 0, 10, 5));
      backButton_ = new Button("Back");
      p.add(backButton_);
      printButton_ = new Button("Print");
      p.add(printButton_);
      closeButton_ = new Button("Close");
      p.add(closeButton_);

      backButton_.addActionListener(new BackHandler());
      printButton_.addActionListener(new PrintHandler());
      closeButton_.addActionListener(new CloseHandler());

      Panel p2 = new Panel();
      p2.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 5));
      p2.add(p);

      f.add("North", p2);
      f.add("Center", bean_);

      f.setSize(550, 700);
      f.setVisible(true);

      bean_.setDocumentString(url);

      }

      class PrintHandler implements ActionListener
      {
      public void actionPerformed(ActionEvent evt)
      {
      bean_.print();
      }
      }


      class BackHandler implements ActionListener
      {
      public void actionPerformed(ActionEvent evt)
      {
      System.out.println("Back pressed");
      docStack_.previousDocument();
      }
      }

      class CloseHandler implements ActionListener
      {
      public void actionPerformed(ActionEvent evt)
      {
      System.exit(0);
      }
      }
      }

            Unassigned Unassigned
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: