Reputation: 402
I'm creating a web service with Java but already at the very start am having problems.
In the line of code below where I ask the context
to get me the ServiceReference
, it returns null
.
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpContext;
import org.osgi.service.http.HttpService;
public class MapService {
public void addUrl(BundleContext context) {
try {
HttpService http;
ServiceReference ref = context.getServiceReference("org.osgi.service.http.HttpService");
http = (HttpService)context.getService(ref);
HttpContext ctx = http.createDefaultHttpContext();
...
Now, what I could find out debugging is that my context
has no servicesInUse
but I'm not sure if that is indicative of something.
I played a bit too with the bundles' start levels with no success, this is my current configuration:
Upvotes: 0
Views: 28