felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Devajyoti Chakraborty" <dchakrabo...@sumglobaltech.com>
Subject RE: Issue with Apache Felix Declarative Service
Date Tue, 31 Jul 2007 13:13:55 GMT

Thanks a lot for your explanation, I was a little confused as to how OSGi
resolves import packages if the package has been exported by two different
bundles. One way of resolving the same could be using version detail, but is
there an algorithm by which the bundle would select packages provided they
have been exported by two bundles with no distinguishing element. In such
cases how does OSGi arrange the order of preference for the bundle exporting
the same package?

As for my problem, we found that we hadn't imported ComponentContext package
in the manifest file. By the way, I am curious to ask, what kind of
debugging strategy can be adopted for OSGi? Because at times the bundles
don't get deployed, but doesn't provide more information as to the reason
why? Though it shows that there was an Error Event generated while starting
the bundle.

Best Regards,

-----Original Message-----
From: Felix Meschberger [mailto:fmeschbe@gmail.com] 
Sent: Tuesday, July 31, 2007 7:15 AM
To: dev@felix.apache.org
Subject: Re: Issue with Apache Felix Declarative Service

Hi Dev,

> 1)      My services bundle get deployed with status Active yet "services"
> command from OSGi prompt,  doesn't show me my service. My bundle was
> within Eclipse Equinox and it worked correctly and also displayed my
> services.

This is quite normal behaviour. Depending on your service declaration,
the Declarative Services Runtime (SCR) might not start your service due
to some services references which cannot be satisfied.

> Since I am using the preference services I have to use the
> "org.osgi.compendium-0.9.0-incubator-SNAPSHOT" bundle and in order to use
> declarative services I am using the
> "org.apache.felix.scr-0.9.0-incubator-SNAPSHOT   " bundle.  I assume that
> since the same packages are being exported by two bundles it's a potential
> problem. 

This is one of the great things about OSGi :-) Multiple bundles may
provide the same packages (to not create needless dependencies) and the
framework will then decide which packages to actually use. In your case
the framework might decide to create wires for the
org.osgi.service.component package to the osg.osgi.componendium bundle
and not to use the same package from the scr o.a.felix.bundle at all. 

In short, it is the task of the OSGi framework to resolve these
collissions and frameworks are very good at that :-)

> Can someone help me out with the issue as to why I am unable to run the
> declarative service bundle inside Felix?

As I said earlier, this might be due to an unsatisfied service
requirement of your declared component.

Hope this helps.


View raw message