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

JCK1.4: Some api/java_net tests throw unexpected NullPointerException, plugin

XMLWordPrintable

    • rc1
    • x86, sparc
    • linux, solaris_2.6, windows_nt
    • Verified

      Name: iaR10016 Date: 10/16/2001

      JDK : JDK1.4.0-beta-b83
                       (The tests pass with JDK1.4.0-beta-b82)
      JCK : JCK1.4-b11
      Platform[s] : RedHat Linux 7.1, Windows NT
      switch/Mode : Plugin with Netscape Communicator 4.76, 6.1, Internet Explorer 5.0
                       (the tests pass under appletviewer)
      JCK test owner : http://javaweb.eng/jck/usr/owners.jto
      Failing Tests : api/java_net/URLConnection/descriptions.html#getLastModified [URLConnection2019]
                       api/java_net/URLConnection/descriptions.html#getContent [URLConnection2038, URLConnection2242, URLConnection2243, URLConnection2244]
                       api/java_net/URLConnection/descriptions.html#getHeaderField
                       api/java_net/URLConnection/descriptions.html#getInputStream [URLConnection2035]
                       api/java_net/HttpURLConnection/index.html#getErrorStream [HttpURLConnection2008]
                       api/java_net/URLConnection/descriptions.html#getExpiration [URLConnection2022]
                       api/java_net/URLConnection/descriptions.html#getContentType [URLConnection2010]
                       api/java_net/HttpURLConnection/index.html#getResponseMessage [HttpURLConnection2004]
                       api/java_net/HttpURLConnection/index.html#getResponseCode [HttpURLConnection2003]
                       api/java_net/URLConnection/descriptions.html#getContentLength [URLConnection2007]
                       api/java_net/URL/descriptions.html#IOException [URL2055, URL2056, URL2057]
                       api/java_net/distributed/index.html#NetDistributed [distributed2001, distributed2003, distributed2005, distributed2013]
                       api/java_net/URL/descriptions.html#getContent [URL2016, URL1059]
                       api/java_net/URL/descriptions.html#openStream [URL2015, URL1056]
                       api/java_net/HttpURLConnection/index.html#Disconnect [HttpURLConnection2001]
                       api/java_net/HttpURLConnection/index.html#getHeaderFieldDate [HttpURLConnection0011, HttpURLConnection0012, HttpURLConnection0013]
                       api/java_net/URLConnection/descriptions.html#guessContentType [URLConnection2029]

      Method URLConnection.getContent() throws unexpected java.lang.NullPointerException when running
      under plugin.

      The following test example demonstrates the bug.
      Please, compile test.java under RedHat Linux 7.1 and then open test.html using
      Netscape Navigator 4.76 or Netscape Navigator 6.1 (probably, you need to change
      httpURL parameter in the test.html file):

      -------------------- test.java --------------------
      import java.applet.*;
      import java.net.*;

      public class test extends Applet {

          public static void main(String argv[]) { run(argv[0]); }
          public void init() { run(getParameter("httpURL")); }

          public static void run(String httpURL) {
              try {
           URLConnection conn = (new URL(httpURL)).openConnection();
           Object is = conn.getContent();
           System.out.println("No exceptions!");
              } catch (Exception e) {
           e.printStackTrace();
              }
          }
      }
      -------------------- test.html --------------------
      <html>
      <EMBED type=application/x-java-applet
         code=test
         httpURL=http://novo64:8086
      >
      </html>
      ---------------------------------------------------

      Sample output is:
      ...
      java.lang.NullPointerException
       at sun.plugin.cache.Cache.getFileExtension(Cache.java:262)
       at sun.plugin.cache.FileCache.isSupported(FileCache.java:186)
       at sun.plugin.cache.FileCache.get(FileCache.java:126)
       at sun.plugin.net.protocol.http.HttpURLConnection.connectWithCache(HttpURLConnection.java:198)
       at sun.plugin.net.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:144)
       at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:290)
       at java.net.URLConnection.getContent(URLConnection.java:585)
       at test.run(test.java:12)
       at test.init(test.java:7)
       at sun.applet.AppletPanel.run(AppletPanel.java:344)
       at java.lang.Thread.run(Thread.java:539)
      ...

      Please, note that the bug is not reproducible in default JDK mode and under appletviewer on the
      same machine. Sample output is:

      ...
      $ java test http://novo64:8086
      No exceptions!
      $
      ...

      Test source location:
      =====================
      /net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14/tests/api/java_net/URL/*.java
      /net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14/tests/api/java_net/URLConnection/*.java
      /net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14/tests/api/java_net/HttpURLConnection/*.java
      /net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14/tests/api/java_net/distributed/*.java

      jtr file location:
      ==================
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/URLConnection/descriptions_getLastModified.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/URLConnection/descriptions_getContent.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/URLConnection/descriptions_getHeaderField.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/URLConnection/descriptions_getInputStream.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/HttpURLConnection/index_getErrorStream.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/URLConnection/descriptions_getExpiration.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/URLConnection/descriptions_getContentType.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/HttpURLConnection/index_getResponseMessage.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/HttpURLConnection/index_getResponseCode.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/URLConnection/descriptions_getContentLength.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/URL/descriptions_IOException.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/distributed/index_NetDistributed.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/URL/descriptions_getContent.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/URL/descriptions_openStream.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/HttpURLConnection/index_Disconnect.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/HttpURLConnection/index_getHeaderFieldDate.jtr
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b83/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api/java_net/URLConnection/descriptions_guessContentType.jtr

      Test output:
      =============
      Executing command via localhost.localdomain,port=33037,localport=1944
      java.lang.NullPointerException
              at sun.plugin.cache.Cache.getFileExtension(Cache.java:262)
              at sun.plugin.cache.FileCache.isSupported(FileCache.java:186)
              at sun.plugin.cache.FileCache.get(FileCache.java:126)
              at sun.plugin.net.protocol.http.HttpURLConnection.connectWithCache(HttpURLConnection.java:198)
              at sun.plugin.net.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:144)
              at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:290)
              at java.net.URLConnection.getContent(URLConnection.java:585)
              at javasoft.sqe.tests.api.java.net.URLConnection.getContentTests.URLConnection2038(getContentTests.java:178)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
              at java.lang.reflect.Method.invoke(Method.java:327)
              at javasoft.sqe.javatest.lib.MultiTest.invokeTestCase(MultiTest.java:407)
              at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:203)
              at com.sun.jck.lib.ExecJCKTestSameJVMCmd.executeStandardTest(ExecJCKTestSameJVMCmd.java:226)
              at com.sun.jck.lib.ExecJCKTestSameJVMCmd.run(ExecJCKTestSameJVMCmd.java:160)
              at com.sun.javatest.agent.Agent$Task.executeCommand(Agent.java:747)
              at com.sun.javatest.agent.Agent$Task.execute(Agent.java:676)
              at com.sun.javatest.agent.Agent$Task.handleRequest(Agent.java:534)
              at com.sun.javatest.agent.Agent.handleRequestsUntilClosed(Agent.java:320)
              at com.sun.javatest.agent.Agent.access$000(Agent.java:56)
              at com.sun.javatest.agent.Agent$1.run(Agent.java:208)
              at java.lang.Thread.run(Thread.java:539)
      URLConnection2038: Failed. Test case throws exception: java.lang.NullPointerException
      ...
      URLConnection2244: Failed. Test case throws exception: java.lang.NullPointerException
      result: Failed. tests: 7; passed: 3; failed: 4; first test case failure: URLConnection2038

      Specific Machine Info:
      =====================
      Hostname: Linux-14
      OS: RedHat Linux 7.1

      Hostname: Linux-21
      OS: Windows NT 4.0

      ======================================================================

      Name: iaR10016 Date: 10/25/2001


      The following tests also fail due to this bug with JCK1.4-b12, JDK1.4.0-beta-b84,
      plugin, Netscape 6.1 under Windows NT 4.0:
      api/java_net/URLConnection/descriptions.html#RequestProperty
      api/java_net/URLConnection/descriptions.html#AllowUserInteraction [URLConnection2001]
      api/java_net/URLConnection/descriptions.html#UseCaches [URLConnection1035]


      ======================================================================

            mcolburnsunw Michael Colburn (Inactive)
            irasunw Ira Ira (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: