code: @Override
      public void registerListener(IServletContext isc) {
  
          CDIWebRuntime cdiWebRuntime = getCDIWebRuntime();
          if (cdiWebRuntime != null && cdiWebRuntime.isCdiEnabled(isc)) {
              ModuleMetaData moduleMetaData = getModuleMetaData(isc);
              BeanManager beanManager = cdiWebRuntime.getModuleBeanManager(moduleMetaData);
              if (beanManager != null) {
                  // check to see if the ConversationFilter is mapped.  If so we need to set a context init property
                  // to prevent WeldInitialListener from doing conversation activation
                  List<IFilterMapping> filterMappings = isc.getWebAppConfig().getFilterMappings();
                  for (IFilterMapping filterMapping : filterMappings) {
                      IFilterConfig filterConfig = filterMapping.getFilterConfig();
                      if (CDIWebConstants.CDI_CONVERSATION_FILTER.equals(filterConfig.getFilterName())) {
                          isc.setInitParameter(CONVERSATION_FILTER_REGISTERED, Boolean.TRUE.toString());
                      }
                  }
                  /*
                   * Workaround jira https://issues.jboss.org/browse/WELD-1874
                   * To make sure that the WeldInitialListener has the correct beanManager we
                   * have to pass a BeanManagerImpl into the constructor, however we do not
                   * know if we have a BeanManagerImpl or a BeanManagerProxy.
                   */
                  BeanManagerImpl beanManagerImpl = null;
  
                  if (beanManager instanceof BeanManagerProxy) {
                      BeanManagerProxy proxy = (BeanManagerProxy) beanManager;
                      beanManagerImpl = proxy.delegate();
                  } else if (beanManager instanceof BeanManagerImpl) {
                      beanManagerImpl = (BeanManagerImpl) beanManager;
                  } else {
                      throw new RuntimeException("Unexpected beanManager instance.");
                  }
                  EventListener weldInitialListener = WeldListenerFactory.newWeldInitialListener(beanManagerImpl);
                  isc.addListener(weldInitialListener);
                  isc.setAttribute(WELD_INITIAL_LISTENER_ATTRIBUTE, weldInitialListener);
                  //End of workaround
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      Tr.debug(tc, "added WeldInitialListener to the servlet context");
  
                  //Put bean manager on the servlet context
                  isc.setAttribute("javax.enterprise.inject.spi.BeanManager", beanManager);
              }
  
          }
  
      }
docs: {@inheritDoc}