Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-9880

ServletContainerInitializer@onStartup is not invoked for deployment

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 12.0.0.Beta1
    • Web (Undertow)
    • None
    • Hide
      1. unzip wildfly
      2. cd WILDFLY_HOME
      3. mkdir -p modules/system/layers/base/servlet-container-init/main/
      4. cp module.xml modules/system/layers/base/servlet-container-init/main/.
      5. cp servlet-container-init.jar modules/system/layers/base/servlet-container-init/main/.
      6. start wildfly
      7. in wildfly CLI - deploy attached app
        deploy deployment-with-dep.war
      8. we expect to see INFO message with "Servlet init started" and then "Servlet init finished" text but no such message is printed
      Show
      unzip wildfly cd WILDFLY_HOME mkdir -p modules/system/layers/base/servlet-container-init/main/ cp module.xml modules/system/layers/base/servlet-container-init/main/. cp servlet-container-init.jar modules/system/layers/base/servlet-container-init/main/. start wildfly in wildfly CLI - deploy attached app deploy deployment-with-dep.war we expect to see INFO message with "Servlet init started" and then "Servlet init finished" text but no such message is printed

    Description

      The ServletContainerInitializer@onStartup is not invoked for deployment. See Steps to Reproduce.

      Problematic part seems to be on this line in Undertow

                          //then run the SCI's
      --->                for (final ServletContainerInitializerInfo sci : deploymentInfo.getServletContainerInitializers()) {
                              final InstanceHandle<? extends ServletContainerInitializer> instance = sci.getInstanceFactory().createInstance();
                              try {
                                  instance.getInstance().onStartup(sci.getHandlesTypes(), servletContext);
                              } finally {
                                  instance.release();
                              }
                          }
      

      It looks like calling deploymentInfo.getServletContainerInitializers() does not include our deployment and simply ignores it.

      Attachments

        1. deployment-with-dep.war
          0.6 kB
        2. module.xml
          0.4 kB
        3. servlet-container-init.jar
          3 kB

        Issue Links

          Activity

            People

              sdouglas1@redhat.com Stuart Douglas
              jstourac@redhat.com Jan Stourac
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: