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

JAVAX: AppletClassLoader fails to get resource from same JAR as applet code.

    XMLWordPrintable

Details

    Description

      AppletClassLoader fails to get resource from same JAR as applet code.

      The AppletClassLoader does not retrieve an image resource via its
      AppletClassLoader.getResource() method call for the case when the
      image resource is contained in the same JAR file where the java
      program is.

      The test case for this is: javax/tests/dwn/T11

      Notice that this test case uses "appletviewer" and hence uses the
      AppletCLassLoader.

      Type "make all; make run" to run the test. It fails to get the image
      resource "sunlogo.gif" by the AppletClassLoader.getResource() method
      call.

      Here is the contents of the JAR file for test T11.

         490 Wed Feb 11 13:51:32 EST 1998 META-INF/MANIFEST.MF
         270 Wed Feb 11 13:48:44 EST 1998 AppType.class
        5159 Wed Feb 11 13:48:46 EST 1998 T11.class
         473 Wed Feb 11 13:48:44 EST 1998 T11Frame$1.class
         965 Wed Feb 11 13:48:44 EST 1998 T11Frame.class
           0 Wed Feb 11 13:48:46 EST 1998 images/
           0 Wed Feb 11 13:48:46 EST 1998 images/SCCS/
        3027 Wed Feb 11 13:48:46 EST 1998 images/SCCS/s.sunlogo.gif
        1962 Wed Feb 11 13:48:46 EST 1998 images/sunlogo.gif

      Here is the manifest file as part of the above JAR.

      Manifest-Version: 1.0
      Main-Class: T11
      Class-Path: ext/e1/e1.jar ext/e2/e2.jar

      The AppletClassLoader should retreive the image "images/sunlogo.gif" from
      the JAR file using AppletClassLoader.getResource("images/sunlogo.gif") but
      it does not.

      On another note this same test works when using the "java" interpreter
      instead of "appletviewer". Check out test case "javax/tests/dwn/T10"
      which is the same test but uses the "java" interpreter which uses
      URLClassLoader which PASSES. So thus URLClassLoader does retrieve the
      image resource from the JAR file while AppletClassLoader does not.

      Attachments

        Activity

          People

            dconnellsunw David Connelly (Inactive)
            aefreche Alan Frechette (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: