Damian Minkov wrote:
Hi,

I'm not sure I've understood the question - but if the question is whether I import the package the answer is yes :) Actually the package "Service-Found-In-SomeBundle" is exported from someBundle. And the pseudo code in my previous mail is actually in other bundle which imports this package.

Well, that is probably the cause of your difficulty then. As you probably know, uninstalling a bundle does not remove its packages, leaving them available for existing bundles that are using them. However, uninstalling a bundle does make the packages unavailable to subsequently installed bundles (personally, I didn't like this clarified R4 interpretation of how uninstalled packages are treated, but that is the way it works now).

So, in short, when you uninstall and re-install the new version of "someBundle", it is using its "new" version of the service package, while your existing bundle is using the old version of the package. The two classes are from different class loaders, thus they are not compatible, which is why your existing bundle can not see the new service.

The simple way around this is to package your service interfaces in a separate bundle.

-> richard



damencho

Richard S. Hall wrote:
Damian Minkov wrote:
Hello,

In the SIP Communicator project we were happily using oscar 2.0 for a while but have now decided to move to Felix. We are however running into some difficulties so I thought that someone might have an idea what is causing them.

Here is one such Felix related problem that we didn't have with Oscar.

Bundle someBundle ......

bundleContext.getServiceReference("Service-Exported-By-someBundle");
//the service is found and working

someBundle.uninstall();

someBundle = bundleContext.installBundle("Service-Exported-By-someBundle");

bundleContext.getServiceReference("Service-Found-In-SomeBundle"); //!!! Not found

someBundle.getRegisteredServices()
// The "Service-Exported-By-someBundle" is among the registered services

The problem is that the bundlecontext instance we are using seems to not be valid anymore.

Does the code above get access to the service interface of the service provided by "someBundle"? In other words, does the bundle containing the code above access the service using reflection or does the bundle actually have a wire to the service interface package?

-> richard


Reply via email to