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

jar -i omits service providers in index.list

    Details

    • Subcomponent:
      jar
    • Resolved In Build:
      b40
    • CPU:
      generic, x86
    • OS:
      generic, windows_xp

      Description



      Name: boT120536 Date: 01/25/2001


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
      Java HotSpot(TM) Client VM (build 1.3.0, mixed mode)


      When a service provider is compiled into a jar, it must provide files in META-
      INF/services. When a jar -i is run on that file, the META-INF/services
      directory is not added to the directory list in META-INF/INDEX.LIST. When this
      jar is used, the appropriate service providers are not found. When I don't
      create the index in the jar, the service provider is found correctly.

        To reproduce the problem, you can try with any jar that includes a service
      provider or use tritonus:
      1. Download the latest CVS version of Tritonus, from
      http://cvs.sourceforge.net/cvstarballs/tritonus-cvsroot.tar.gz.
      2. build it (on linux) with "make compileinitial && make install"
      3. cd test ; make MpegPlayer.java
      4. java MpegPlayer "mp3file.mp3" should run fine, or at least NOT give the
      error that the conversion is not supported.
      5. jar -i ../dist/tritonus_core.jar
      6. run again the MpegPlayer and the service provider isn't found, with an
      UnsupportedAudioFileException.

      Looking at the source code of jar/sun.misc.JarIndex:187:
                      if (fileName.startsWith("META-INF")) {
                          continue;
                      }
      Everything inside META-INF is not included in INDEX.LIST. I think the service
      provider files should be included in INDEX.LIST, as they are searched by the
      classloader.
      (Review ID: 111540)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sseligmasunw Scott Seligman (Inactive)
                Reporter:
                bonealsunw Bret O'neal (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: