try(WeldContainer weldContainer = new Weld().disableDiscovery()
.extensions(new ConfigurationExtension())
.beanClasses(TomcatWebServer.class, DefaultServlet.class, MessageProvider.class,
WebServerConfiguration.class, DefaultConfigPropertyProducer.class)
.initialize()) {
<BUG>TomcatWebServer tomcat = weldContainer.select(TomcatWebServer.class).get();
tomcat.addServlet(new ServletDescriptor("Default",new String[]{"/*"},new String[]{"/*"},1,new WebInitParam[]{}, true, DefaultServlet.class));
tomcat.addFilter(new FilterDescriptor("Default", null, new String[]{"/rest"},new DispatcherType[]{DispatcherType.REQUEST},null,true,null,DefaultFilter.class));
tomcat.start();</BUG>
try(InputStream stream = new URL("http://localhost:8080/").openStream()) {

try(WeldContainer weldContainer = new Weld().disableDiscovery()
.extensions(new ConfigurationExtension())
.beanClasses(TomcatWebServer.class, DefaultServlet.class, MessageProvider.class,
WebServerConfiguration.class, DefaultConfigPropertyProducer.class)
.initialize()) {
TomcatWebServer tomcat = weldContainer.select(TomcatWebServer.class).get();
BeanManagerImpl beanManager = weldContainer.select(BeanManagerImpl.class).get();
tomcat.addServlet(new ServletDescriptor("Default",new String[]{"/*"},new String[]{"/*"},1,new WebInitParam[]{}, true, DefaultServlet.class));
tomcat.addFilter(new FilterDescriptor("Default", null, new String[]{"/rest"},new DispatcherType[]{DispatcherType.REQUEST},null,true,null,DefaultFilter.class));
tomcat.addInitParameter(org.jboss.weld.Container.CONTEXT_ID_KEY, beanManager.getContextId());
tomcat.start();
try(InputStream stream = new URL("http://localhost:8080/").openStream()) {
