Thanks a lot. This is really what I need. Actually I am just integrating legacy code to osgi environment and that is why I need this "hack".
2008/4/11, Stuart McCulloch <[EMAIL PROTECTED]>: > this is a classic "split-package" problem, where you have > two bundles exporting the same package but with different > content (which is usually a bad idea) > > in OSGi only one bundle will be chosen as the "exporter" > of a given version of a package, so you will see missing > class problems like you mention with split-packages. > > see section 3.13 of the OSGi spec for more discussion of > split-packages, and a solution (Require-Bundle). However, > note that there are side-effects of using Require-Bundle > that mean it should be used very sparingly, usually when > integrating legacy code with OSGi where you don't have > control over the package content > > for new projects where you can refactor your code, it's > advisable to ensure that there's only one set of content > for a given package, as this is much more maintainable > and you get the most out of OSGi wrt. dynamic upgrades > > I often suggest also putting the API/SPI package(s) into > a separate bundle than the implementation, as this makes > it much easier to swap implementations at runtime. > > HTH >
