Source:
<code>public WeldContainer initialize() { ResourceLoader resourceLoader = new WeldSEResourceLoader(); if (resourceLoader.getResource(WeldSEUrlDeployment.BEANS_XML) == null) { throw new IllegalStateException("Missing beans.xml file in META-INF!"); } final CDI11Bootstrap bootstrap; try { bootstrap = (CDI11Bootstrap) resourceLoader.classForName(BOOTSTRAP_IMPL_CLASS_NAME).newInstance(); } catch (InstantiationException ex) { throw new IllegalStateException(ERROR_LOADING_WELD_BOOTSTRAP_EXC_MESSAGE, ex); } catch (IllegalAccessException ex) { throw new IllegalStateException(ERROR_LOADING_WELD_BOOTSTRAP_EXC_MESSAGE, ex); } Deployment deployment = createDeployment(resourceLoader, bootstrap); if (strategy.getClass().getName().equals(JANDEX_ENABLED_DISCOVERY_STRATEGY_CLASS_STRING)) { Class<?> clazz = Reflections.loadClass(WELD_SE_CLASS_FILE_SERVICES_CLASS_NAME, resourceLoader); ClassFileServices classFileServices = null; try { <START> Method declaredMethod = strategy.getClass().getDeclaredMethod("getCindex"); <END> classFileServices = (ClassFileServices) clazz.getConstructor(Object.class).newInstance(declaredMethod.invoke(strategy)); } catch (Exception e) { throw new IllegalStateException("Unable to instantiate WeldSEClassFileServices even when the jandex discovery strategy was instantiated", e); } deployment.getServices().add(ClassFileServices.class, classFileServices); } bootstrap.startContainer(Environments.SE, deployment); bootstrap.startInitialization(); bootstrap.deployBeans(); bootstrap.validateBeans(); bootstrap.endInitialization(); this.shutdownManager = new ShutdownManager(bootstrap); WeldContainer container = getInstanceByType(bootstrap.getManager(deployment.loadBeanDeploymentArchive(WeldContainer.class)), WeldContainer.class); container.event().select(ContainerInitialized.class).fire(new ContainerInitialized()); return container; }</code><technical_language>This is necessary. WeldSEClassFileServices JandexEnabledDiscoveryStrategy constructor's parameter index there. In addition, do this createDeployment() avoid strategy field</technical_language>

Target:
public WeldContainer initialize() { ResourceLoader resourceLoader = new WeldSEResourceLoader(); if (resourceLoader.getResource(WeldSEUrlDeployment.BEANS_XML) == null) { throw new IllegalStateException("Missing beans.xml file in META-INF!"); } final CDI11Bootstrap bootstrap; try { bootstrap = (CDI11Bootstrap) resourceLoader.classForName(BOOTSTRAP_IMPL_CLASS_NAME).newInstance(); } catch (InstantiationException ex) { throw new IllegalStateException(ERROR_LOADING_WELD_BOOTSTRAP_EXC_MESSAGE, ex); } catch (IllegalAccessException ex) { throw new IllegalStateException(ERROR_LOADING_WELD_BOOTSTRAP_EXC_MESSAGE, ex); } Deployment deployment = createDeployment(resourceLoader, bootstrap); bootstrap.startContainer(Environments.SE, deployment); bootstrap.startInitialization(); bootstrap.deployBeans(); bootstrap.validateBeans(); bootstrap.endInitialization(); this.shutdownManager = new ShutdownManager(bootstrap); WeldContainer container = getInstanceByType(bootstrap.getManager(deployment.loadBeanDeploymentArchive(WeldContainer.class)), WeldContainer.class); container.event().select(ContainerInitialized.class).fire(new ContainerInitialized()); return container; }