Uploaded image for project: 'JBoss Web Server'
  1. JBoss Web Server
  2. JWS-760

[ASF BZ 59961] Provide an option to enable/disable processing of Class-Path entry in a jar's manifest file

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • JWS 3.1.0 SP1 ER1
    • JWS 3.1.0 GA
    • tomcat8
    • None
    • Release Notes
    • Hide

      1) Create a JAR with a class-path defined in it's manifest

      $ cat <<'EOF' >> MANIFEST.MF
      > Manifest-Version: 1.0 
      > Created-By: 1.7.0_121-mockbuild_2016_10_31_10_07-b00 (Oracle Corporation) 
      > Class-Path: fail.jar
      > EOF
      $ jar -cfm test.jar MANIFEST.MF
      

      2) Copy the new JAR into Tomcat's lib dir

      $ cp test.jar $CATALINA_HOME/lib
      

      3) Start Tomcat and check for FileNotFoundExceptions for the JAR(s) in the Class-Path of the manifest:

      $ grep FileNotFoundException logs/catalina.out -C1 | head -n3
      WARNING [localhost-startStop-1] org.apache.tomcat.util.scan.StandardJarScanner.scan Failed to scan [file:/tomcat/lib/fail.jar] from classloader hierarchy
       java.io.FileNotFoundException: /tomcat/lib/fail.jar (No such file or directory)
      	at java.util.zip.ZipFile.open(Native Method)
      
      Show
      1) Create a JAR with a class-path defined in it's manifest $ cat <<'EOF' >> MANIFEST.MF > Manifest-Version: 1.0 > Created-By: 1.7.0_121-mockbuild_2016_10_31_10_07-b00 (Oracle Corporation) > Class-Path: fail.jar > EOF $ jar -cfm test.jar MANIFEST.MF 2) Copy the new JAR into Tomcat's lib dir $ cp test.jar $CATALINA_HOME/lib 3) Start Tomcat and check for FileNotFoundExceptions for the JAR(s) in the Class-Path of the manifest: $ grep FileNotFoundException logs/catalina.out -C1 | head -n3 WARNING [localhost-startStop-1] org.apache.tomcat.util.scan.StandardJarScanner.scan Failed to scan [file:/tomcat/lib/fail.jar] from classloader hierarchy java.io.FileNotFoundException: /tomcat/lib/fail.jar (No such file or directory) at java.util.zip.ZipFile.open(Native Method)

      Scenario:

      You want to add a JAR to the common (or shared) classloader which does contain a manifest file referring to other JARs in it's class-path entry. These referenced other JARs are not required for the application and thus are not stored on the server.

      When tomcat is started method "processManifest" of class "org.apache.tomcat.util.scan.StandardJarScanner" tries to resolve that class-path entry and you end up with lots of errors in the log.

      By default scanBootstrapClassPath value is true.

            [JWS-760] [ASF BZ 59961] Provide an option to enable/disable processing of Class-Path entry in a jar's manifest file

            Since the problem described in this issue should be resolved in a recent advisory, it has been closed.

            For information on the advisory, and where to find the updated files, follow the link below.

            If the solution does not work for you, open a new bug report.
            https://access.redhat.com/errata/RHSA-2017:1801

            Errata Tool added a comment - Since the problem described in this issue should be resolved in a recent advisory, it has been closed. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2017:1801

              rhn-support-csutherl Coty Sutherland
              rhn-support-pragshar Prageetika Sharma (Inactive)
              Bogdan Sikora Bogdan Sikora (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: