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

JAVAX: URLClassLoader fails to get resource from directory in Class-Path.

XMLWordPrintable

      URLClassLoader fails to get resource from directory in Class-Path.

      The URLClassLoader does not retrieve an image resource via its
      URLClassLoader.getResource() method call when the image resource
      is specified as a directory in the manifest file of the JAR file
      where the java program is.

      The test cases for this is: javax/tests/dwn/T12

      This test case uses the "java" interpreter and hence uses the
      URLClassLoader.

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

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

         323 Wed Feb 11 13:51:42 EST 1998 META-INF/MANIFEST.MF
         270 Wed Feb 11 13:48:54 EST 1998 AppType.class
        3692 Wed Feb 11 13:48:56 EST 1998 T12.class
         473 Wed Feb 11 13:48:54 EST 1998 T12Frame$1.class
         965 Wed Feb 11 13:48:54 EST 1998 T12Frame.class

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

      Manifest-Version: 1.0
      Main-Class: T12
      Class-Path: images/

      The URLClassLoader should be able to retreive the URL to the image resource
      by calling its URLClassLoader.getResource("images/sunlogo.gif") method.

      Notice that the test javax/tests/dwn/T12b which is the same test case
      as above but uses the "appletviewer" tool PASSES. This test case uses
      the AppletClassLoader which PASSES.
       

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: