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

Applet failed to start if policy file contains https codeBase

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • security-libs



      Name: gm110360 Date: 04/01/2004


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

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      Applet doesn't start if the policy file .java.policy contains entry with codeBase in https, e.g. "https://test/-". Reloading the page causes stack overflow.

      The applett works fine if changing the codeBase to http, e.g. "http://test/-".

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. compile the attached source file and put in on a server.
      2. adjust and install the attached policy file
      3. visit the webpage TestApplet.html


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Java(TM) Plug-in: version 1.5.0
      Using JRE version 1.5.0-beta Java HotSpot(TM) Client VM
      User home directory = D:\Documents and Settings\ccmartin
      network: Loading user-defined proxy configuration ...
      network: Done.
      network: Loading proxy configuration from Internet Explorer ...
      network: Done.
      network: Loading direct proxy configuration ...
      network: Done.
      network: Proxy Configuration: No proxy

      basic: Cache is enabled
      basic: Location: D:\Documents and Settings\ccmartin\Application Data\Sun\Java\Deployment\cache\javapi\v1.0
      basic: Maximum size: unlimited
      basic: Compression level: 0

      ----------------------------------------------------
      c: clear console window
      f: finalize objects on finalization queue
      g: garbage collect
      h: display this help message
      l: dump classloader list
      m: print memory usage
      o: trigger logging
      p: reload proxy configuration
      q: hide console
      r: reload policy configuration
      s: dump system and deployment properties
      t: dump thread list
      v: dump thread stack
      x: clear classloader cache
      0-5: set trace level to <n>
      ----------------------------------------------------

      basic: Registered modality listener
      liveconnect: Invoking JS method: document
      liveconnect: Invoking JS method: URL
      basic: null
      basic: Loading applet ...
      basic: Initializing applet ...
      basic: Starting applet ...
      basic: Stopping applet ...
      basic: Joining applet thread ...
      basic: Joined applet thread ...
      basic: Unregistered modality listener
      basic: Destroying applet ...
      basic: Disposing applet ...
      basic: Quiting applet ...
      basic: null
      basic: null
      basic: Registered modality listener
      liveconnect: Invoking JS method: document
      liveconnect: Invoking JS method: URL
      basic: Referencing classloader: sun.plugin.ClassLoaderInfo@18a6e6e, refcount=1
      java.lang.StackOverflowError
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Pattern$Branch.match(Unknown Source)
      at java.util.regex.Matcher.match(Unknown Source)
      at java.util.regex.Matcher.matches(Unknown Source)
      at javax.crypto.SunJCE_f.a(DashoA6275)
      at javax.crypto.SunJCE_f.a(DashoA6275)
      at javax.crypto.SunJCE_f.b(DashoA6275)
      at javax.crypto.SunJCE_f.a(DashoA6275)
      at javax.crypto.Cipher.getInstance(DashoA6275)
      at com.sun.net.ssl.internal.ssl.JsseJce.getCipher(Unknown Source)
      at com.sun.net.ssl.internal.ssl.CipherBox.<init>(Unknown Source)
      at com.sun.net.ssl.internal.ssl.CipherBox.newCipherBox(Unknown Source)
      at c

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      policy file
      ==========
      grant codeBase "https://server/- {
      permission java.security.AllPermission;
      };

      applet code
      ==========
      import java.applet.*;

      public class TestApplet extends Applet {

      public void init() {
      System.getProperty ("testit");
      System.out.println ("success");
      }
      }


      web page
      =========
      <html>
      <body>
      <applet code="TestApplet.class" codebase="." width="2" height="2">
      </applet>
      </body>
      </html>



      ---------- END SOURCE ----------
      (Incident Review ID: 245861)
      ======================================================================

            claisunw Charlie Lai (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: