Gale Yao
Gale Yao

Reputation: 163

Developing OSGi using intelliJ IDEA

I am learning to develop OSGi application using intelliJ IDEA, I've chosen Apache's felixApache's felix as the runtime, the problem I have encountered is below: the screenshot is here

I have developed module example 1, 2 and 2b, and the package structure of 2b is same as 2, but the service interface is located in module 2, module 2b is just designed to alternate the service, but I can't do that successfully, felix told me that module 2b couldn't find the self.gale.services.DictionaryService, I don't know how to make module 2b can find the service which is defined in the exact package in module 2.

I guess the problem is here

the start method of the Activator in module 2b:

public void start(BundleContext context)
{
    Hashtable<String, String> props = new Hashtable<>();
    props.put("Language", "French");
    context.registerService(
            DictionaryService.class.getName(), new DictionaryServiceImpl(), props);
}

the manifest property of module 2b Import-Package: org.osgi.framework,self.gale.services

What I mean the package self.gale.services is located in the module 2, not this 2b, but it seems couldn't find that package.

Upvotes: 0

Views: 1045

Answers (1)

cagrias
cagrias

Reputation: 1847

You also need to provide "self.gale.services" exposed in the Export-Package of your bundle "2" MANIFEST file and make sure the versions of "self.gale.services" in both MANIFEST files corresponds each other.

Upvotes: 2

Related Questions