Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2122

Support handling archives from WEB-INF/lib on Tomcat 8 with unpackWARs=false

    Details

      Description

      Weld seems to not support scanning of JAR files inside a WAR file.

      We do hit this line in Tomcat 8(Servlet 3.1 container):
      https://github.com/weld/core/blob/master/environments/common/src/main/java/org/jboss/weld/environment/deployment/discovery/AbstractDiscoveryStrategy.java#L105

      we are running Tomcat server in unpackWARs=false mode.

      So a jar library inside the war deployment will be correctly detected by the WebAppBeanArchiveScanner ( https://github.com/weld/core/blob/master/environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/deployment/WebAppBeanArchiveScanner.java#L77 ) with a path like:

      jar:war:file:/path/to/webapp.war*/WEB-INF/lib/included-cdi-lib.jar

      But the handler https://github.com/weld/core/blob/master/environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/deployment/ServletContextBeanArchiveHandler.java
      only seems to support to handle WEB-INF/classes directory.

      It seems to miss the handling of resources inside the ServletContext.

      As most people will run Tomcat with unpackWars=true, I guess the normal file based handler will pickup the jar inside a war and that's why it works for this case.

      so what do you think: bug or feature?

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mkouba Martin Kouba
                  Reporter:
                  thomasmey Thomas Meyer
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: