While there are a ton of benefits to be gained from adopting OSGi, it’s not a trivial task to migrate your existing code. Class loader issues can bite you and perhaps the biggest pain-point is the migration of third-party libraries.
Third-party libraries are a problem because while bundle repositories are growing in size, there are still a lot of JARs out there not packaged as OSGi bundles.
So what can we do to make it easier to adopt OSGi?
The Knoplerfish answer
Well it turns out that the Knoplerfish OSGi framework has solutions to many of these issues. Among the features offered are:
- Automatic runtime generation of manifests for non-bundle JARs
- Automatic patching of code that uses inappropriate (for OSGi anyway) class loading mechanisms
- Ability to execute
static main
methods inside of the framework
These solutions are covered in detail in this presentation given last year.
Why are these solutions not more popular?
I’m wondering why these types of solutions are not discussed and suggested more. Are there similar features in Equinox and Felix that I’m not aware of? And if not, are there any plans to implement them?
I’d love to hear from others whether features like these would be useful to you or not. I’d also be interested to hear what else could be done to make OSGi adoption easier. In my opinion, the difficulty of migrating applications to OSGi is one of the main things holding it back. What can we do to fix this?