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/d59ba9ea-e579-4025-8bdf-7d2938000e8en%40googlegroups.com.

Reply via email to