Details

    • Type: Bug
    • Status: Closed (View workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 1.4.18
    • Fix versions: 1.4.19
    • Components: Tomcat
    • Labels:
      None

      Description

      I had fix an issue with Tomcat 8 Resources Loading in CARGO-1361 Closed .
      But after using cargo 1.4.18 with other projects I saw that it will possible to have some loading bug with 2 major cases :

      1. Classes defined before libs, are not loading before libs
        <Resources>
        <PostResources base="/Users/thomascollignon/Documents/Workspace_eclipse/testWebapp/target/classes" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/WEB-INF/classes"/>
        <PostResources base="/Volumes/Macintosh_HD_2/Work/mavenRepository/com/tco/testJar/0.0.2-SNAPSHOT" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/WEB-INF/lib" />
        </Resources>
        

        A class with same name is present in target/classes et in the jar. After Tomcat 8 started I saw that is the jar class who being load first every time.

      2. If directory declared contains many lib (such as maven repository with SNAPSHOT for example), all will be loaded, it's not that we want, it must declared the good file if it's given
        <Resources>
        <PostResources base="/Volumes/Macintosh_HD_2/Work/mavenRepository/com/tco/testJar/0.0.2-SNAPSHOT" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/WEB-INF/lib" />
        </Resources>
        

        The directory 0.0.2-SNAPSHOT contains 2 jars. I want only one.

      After many search in the Tomcat source code, I think the best implementation for JAR, is this:

      <PostResources base="/Volumes/Macintosh_HD_2/Work/mavenRepository/com/tco/testJar/0.0.2-SNAPSHOT/testJar-0.0.2-SNAPSHOT.jar" className="org.apache.catalina.webresources.JarResourceSet" webAppMount="/WEB-INF/classes"/>
      

      It's pretty surprising for me, but I have test many possibilities, and it's the only one who work if we want reference the file, and not the folder.

      I give a PR to do this

        Attachments

          Activity

            People

            • Assignee:
              tcollignon Thomas Collignon
              Reporter:
              tcollignon Thomas Collignon
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: