Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Won't Fix
-
None
-
None
-
None
-
Windows 10
org.apache.felix.framework-6.0.3
osgi.cmpn-7.0.0
javax.servlet-3.1.0
apache cxf 3.3.5
Description
Our development requirement needs us to get the org.osgi.service.http.HttpService reference during the activation of our bundle, but the tests show the HttpService reference is always null if we want to locate it from the bundle context.
The following is a simple example. "myServlet" is registered by calling "bundleContext.registerService" with whiteboard pattern. According to tests, we do get the org.osgi.service.http.HttpService reference by registering a ServiceListener , but the HttpService reference is not ready unless we REALLY make a web call to the web service itself. Actually the dumped HttpService is an org.apache.felix.http.base.internal.service.PerBundleHttpServiceImpl object. So, it seems the HttpService is lazy started.
We do not want the HttpService to be lazy started. The question is, is there any config or setting can be used so that when bundleContext.registerService() is called the HttpService reference will also be ready? Thanks.
@Activate
public void activate(ComponentContext ctx)
Regards.
Justin