Perhaps this was a wrong approach since the Pax-Web-Extender-War worked (for servlets) with the Servlet Bridge and with the Pax-Web-Runtime not installed. So, the runtime is not required.
On the other hand, the runtime is the bundle responsible for creating the WebContainer service, and this is the problem. So, it seems I should provide my own WebContainer implementation for JSPs. Is that right? If so, could I reuse the code from the Runtime? On Wednesday, May 5, 2021 at 10:38:01 PM UTC+2 Pablo Beltran wrote: > Hi, > > I'm following this example to register a JSP file. > > > https://github.com/ops4j/org.ops4j.pax.web/blob/master/samples/helloworld-jsp/src/main/java/org/ops4j/pax/web/samples/helloworld/jsp/internal/Activator.java > > However, the org.ops4j.pax.web.service.WebContainer service is not > initialized. > > The initialization of that service happens in the Activator of the > Pax-web-Runtime bundle. > > In particular, within this method: > > > > protected void updateController(Dictionary<String, ?> dictionary, > ServerControllerFactory controllerFactory) > > But the code is a bit weird. > > When the bundle is activated and the activator started the method is > invoked: > > At this time, the local variable *initialConfigSet* value is false > ======== > if (!initialConfigSet) { > initialConfigSet = true; > this.config = dictionary; > this.factory = controllerFactory; > dynamicsServiceTracker = new ServiceTracker<>( > bundleContext, ServerControllerFactory.class, > new DynamicsServiceTrackerCustomizer()); > dynamicsServiceTracker.open(); > *return*; > ========= > } > so, the code inside the block runs, and the method returns. > > It seems this method is designed to be invoked twice. But the second call > never happens and the code that initializes the WebContainer service is > never executed: > > =============== > httpServiceFactoryReg = bundleContext.registerService( > new String[] { HttpService.class.getName(), *WebContainer.class.getName*() > }, > *new HttpServiceFactoryImpl*() { > @Override > HttpService createService(final Bundle bundle) { > return new HttpServiceProxy(new HttpServiceStarted( > bundle, serverController, serverModel, > servletEventDispatcher, configuration.get(PROPERTY_SHOW_STACKS))); > } > }, props); > ============== > > In my environment, Eclipse Equinox, PAX web is tied to the Servlet Bridge > (HttpService). > > Any idea? > > Pablo > > > -- -- ------------------ OPS4J - http://www.ops4j.org - [email protected] --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/02c3623b-21a5-4272-9b4c-ed603054d4b3n%40googlegroups.com.
