Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-1235

ServletContext#getResourcePaths returns erroneous additional paths for exploded war libs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 1.4.0.Final, 1.4.18.Final
    • Servlet
    • None

      If a jar in a war/WEB-INF/lib is exploded, then ServletContext#getResourcePaths behaves differently.
      The reproducer is attached, it walks the resources recursively when deployed.
      Packaged war lib:

      2017-11-15 12:42:19,552 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) Walking war resources
      2017-11-15 12:42:19,552 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /
      2017-11-15 12:42:19,557 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /META-INF/
      2017-11-15 12:42:19,558 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /META-INF/maven/
      2017-11-15 12:42:19,559 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /META-INF/maven/my.reproducer/
      2017-11-15 12:42:19,561 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /META-INF/maven/my.reproducer/war/
      2017-11-15 12:42:19,562 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /META-INF/maven/my.reproducer/war/pom.properties
      2017-11-15 12:42:19,563 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /META-INF/maven/my.reproducer/war/pom.xml
      2017-11-15 12:42:19,564 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /META-INF/MANIFEST.MF
      2017-11-15 12:42:19,564 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /immaresource.xml
      2017-11-15 12:42:19,565 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /WEB-INF/
      2017-11-15 12:42:19,567 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /WEB-INF/lib/
      2017-11-15 12:42:19,569 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /WEB-INF/lib/warlib-1.0-SNAPSHOT.jar
      2017-11-15 12:42:19,570 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /WEB-INF/classes/
      2017-11-15 12:42:19,571 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /WEB-INF/classes/DiscoverResources.class
      2017-11-15 12:42:19,572 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /WEB-INF/web.xml
      2017-11-15 12:42:19,573 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /WEB-INF/beans.xml
      2017-11-15 12:42:19,573 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) /index.xhtml
      2017-11-15 12:42:19,574 INFO  [DiscoverResources] (ServerService Thread Pool -- 83) Done walking
      

      Exploded war lib:

      2017-11-15 13:05:48,376 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) Walking war resources
      2017-11-15 13:05:48,377 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /
      2017-11-15 13:05:48,379 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /META-INF/
      2017-11-15 13:05:48,380 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /META-INF/maven/
      2017-11-15 13:05:48,381 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /META-INF/maven/my.reproducer/
      2017-11-15 13:05:48,382 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /META-INF/maven/my.reproducer/war/
      2017-11-15 13:05:48,383 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /META-INF/maven/my.reproducer/war/pom.properties
      2017-11-15 13:05:48,384 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /META-INF/maven/my.reproducer/war/pom.xml
      2017-11-15 13:05:48,385 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /META-INF/MANIFEST.MF
      2017-11-15 13:05:48,386 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /immaresource.xml
      2017-11-15 13:05:48,386 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/
      2017-11-15 13:05:48,387 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/lib/
      2017-11-15 13:05:48,388 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/lib/warlib-1.0-SNAPSHOT.jar/
      2017-11-15 13:05:48,390 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/lib/warlib-1.0-SNAPSHOT.jar/META-INF/
      2017-11-15 13:05:48,391 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/lib/warlib-1.0-SNAPSHOT.jar/META-INF/resources/
      2017-11-15 13:05:48,393 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/lib/warlib-1.0-SNAPSHOT.jar/META-INF/resources/immaresource.xml
      2017-11-15 13:05:48,394 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/lib/warlib-1.0-SNAPSHOT.jar/META-INF/MANIFEST.MF
      2017-11-15 13:05:48,394 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/lib/warlib-1.0-SNAPSHOT.jar/META-INF/maven/
      2017-11-15 13:05:48,396 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/lib/warlib-1.0-SNAPSHOT.jar/META-INF/maven/my.reproducer/
      2017-11-15 13:05:48,397 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/lib/warlib-1.0-SNAPSHOT.jar/META-INF/maven/my.reproducer/warlib/
      2017-11-15 13:05:48,398 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/lib/warlib-1.0-SNAPSHOT.jar/META-INF/maven/my.reproducer/warlib/pom.properties
      2017-11-15 13:05:48,399 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/lib/warlib-1.0-SNAPSHOT.jar/META-INF/maven/my.reproducer/warlib/pom.xml
      2017-11-15 13:05:48,401 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/classes/
      2017-11-15 13:05:48,403 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/classes/DiscoverResources.class
      2017-11-15 13:05:48,403 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/web.xml
      2017-11-15 13:05:48,404 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /WEB-INF/beans.xml
      2017-11-15 13:05:48,405 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) /index.xhtml
      2017-11-15 13:05:48,406 INFO  [DiscoverResources] (ServerService Thread Pool -- 99) Done walking
      

      Note the additional entries about walking the war lib directory structure.
      Expected behavior: getResourcePaths produces identical results for exploded war libs, like it does for packaged. As its javadoc says: "Returns a directory-like listing of all the paths to resources" - it's concern is resources, not actual files and directories.

            rhn-cservice-bbaranow Bartosz Baranowski
            vsevolodgol Vsevolod Golovanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: