Ok, so in the end I did have to sublcass WebBeansConfigurationListener. The issue I ran into was that in contextInitialized you're attempting to start the application. Since I do my servlet initialization in a @Observes @Initialized(ApplicationScoped.class) callback, OWB was firing the event that was already in progress. This causes a stackoverflow. My overridden version doesn't do the application start up logic.
I don't know if it makes sense to roll this listener into OWB instead of keeping it outside. It could be controlled via external configuration I suppose. Everything else seems to work well. Let me know, I can provide a patch. John On Tue, Dec 27, 2016 at 12:27 AM John D. Ament <johndam...@apache.org> wrote: > Nevermind, I forgot about openwebbeans.properties. Mix and match for the > win. > > John > > > On Mon, Dec 26, 2016 at 11:55 PM John D. Ament <johndam...@apache.org> > wrote: > > Hi, > > So let's say I'm using Tomcat embedded and OWB. I bootstrap OWB using its > normal function, and I have impl, web and resource on my classpath. When I > ask for the ContainerLifecycle service, I get back a WebContainerLifecycle > since I have web on the classpath. So I'm wondering, does it make sense to > create a fake servlet context in this scenario? I believe if I do that, > OWB will treat these as two different contexts and as a result the > instances won't be shared. > > I'm almost thinking this would require a new plugin in OWB that did a lot > of the same work, however it allows the sharing of the context. Thoughts? > > John > >