Hi
I'm using pax-web 7.3.5. In the activate() method of my OSGi bundle I'm doing the following:
final ServiceReference<WebContainer> ref = ctx.getServiceReference(WebContainer.class);
final WebContainer webCont = ctx.getService(ref);
webCont.registerWelcomeFiles(new String[] { "index.html" }, true, null);
and I'm getting the following error. I also tried with a non-null HttpContext, but I'm hitting the same exception:
org.apache.felix.log.LogException: org.ops4j.lang.NullArgumentException: Context model is null.
at org.ops4j.lang.NullArgumentException.validateNotNull(NullArgumentException.java:74)
at org.ops4j.pax.web.service.spi.model.Model.<init>(Model.java:27)
at org.ops4j.pax.web.service.spi.model.WelcomeFileModel.<init>(WelcomeFileModel.java:32)
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerWelcomeFiles(HttpServiceStarted.java:1005)
at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerWelcomeFiles(HttpServiceProxy.java:364)
I'm on Apache Felix, not on Karaf.
Silvano