On 12/30/09 9:36, Karl Pauls wrote:
On Wed, Dec 30, 2009 at 12:55 PM, Vadeg<[email protected]>  wrote:
Greetings!

I've recreated example, where Bundle is called from Host Application from
your site:

http://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html#ApacheFelixFrameworkLaunchingandEmbedding-hostservices

named "Using Services Provided by Bundles"

But I can't get it work.

The trouble is in getting service from bundle context. Felix check, is the
class, loaded from bundle service reference is the same as the class, loaded
from my app by comparing them by ==
(org.apache.felix.framework.ServiceRegistrationImpl#isClassAccessible)

But, of course it's not the same class, because they loaded by different
classloaders. One class is loaded by classloader of my app, the other one
with the same name is loaded by bundle classloader. Because of that, I can't
call bundle from my app.

- I've put property FRAMEWORK_SYSTEMPACKAGES_EXTRA where put the package
name of my interface.
- I have a jar with my interface. This jar is deployed as bundle in felix
and present in classpath of my app.

It seems that it must work, but it didn't :)
Well, it looks like your bundle is getting its interface package from
the installed bundle instead of from the system bundle. Maybe you
didn't give a (or an incorrect) version to the package in the
FRAMEWORK_SYSTEMPACKAGES_EXTRA?

Or else the bundle providing the service only exports the service interface package and doesn't import it too, which means the framework couldn't substitute the one provided by the system bundle.

-> richard

regards,

Karl

Can someone provide a working example?



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to