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

Can't view applets that use authentication: http://www.dreamone.com/testes/

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • 1.4.0
    • 1.3.0_01
    • deploy
    • beta2
    • x86
    • generic

    Description

      This is from bugzilla bug: http://bugzilla.mozilla.org/show_bug.cgi?id=80685

      Reproducible: Always
      Steps to Reproduce:
      1. Go to http://www.dreamone.com/
      2. Notice applet with peom quote works
      3. Go to http://www.dreamone.com/testes/
      4. Input username "testing" password "test" to browser
      5. input username "testing" password "test" to Java applet
      6. Notice applet does not work.

      This is from my own analysis.

      Problem 1: The Sun java plugin doesn't check for a null return from
      Authenticator.getRequestingSite here:

      D:\Projects\ladybird\ext\plugin\java\src\sun\plugin\PluginAuthenticator.java
      getPasswordAuthentication():

      // Request the username/password from the user
      pa = openDialog(getRequestingSite().toString(), getRequestingPrompt(), getRequestingScheme());

      This causes the password dialog not to be opened, which causes the
      applet to fail.

      Problem 2:

      The reason getRequestingSite() returns null is in:

      D:\Projects\ladybird\src\share\classes\sun\net\www\protocol\http\HttpURLConnection.java
      getServerAuthentication()

      if (ret == null) {
      try {
      addr = InetAddress.getByName(url.getHost());
      } catch (java.net.UnknownHostException ignored) {
      // User will have an unknown host.
      System.out.println("debug: edburns: Unknown host, plugin gets NullPointerException");
      }
      }

      When I recompile the HttpURLConnection.java and run with the recompiled
      class, the error message is:

      debug: edburns: Unknown host, plugin gets NullPointerException: url: http://www.dreamone.com/testes/dreams.class

      For some reason, InetAddress.getByName() is failing.

      I have posted a fix to the "Suggested Fix" section. This fix allows the applet to work on my machine.

      Attachments

        Activity

          People

            stanleyh Stanley Ho (Inactive)
            ejburns Ed Burns (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: