Java 8 & Missing required capability Require-Capability: osgi.ee; filter=”(&(osgi.ee=JavaSE)(version=1.8))”

The error means that your bundle has a Require-Capability: osgi.ee; filter=”(&(osgi.ee=JavaSE)(version=1.8))” entry in its manifest. So this means the bundle will only start when there is a bundle that provides this capability. In case of the osgi.ee capability it is the OSGi framework (equinox) that should provide this capability. Apparently it does not do this. … Read more

Programmatically Start OSGi (Equinox)?

Any OSGi framework (R4.1 or later) can be started programmatically using the FrameworkFactory API: ServiceLoader<FrameworkFactory> ffs = ServiceLoader.load(FrameworkFactory.class); FrameworkFactory ff = ffs.iterator().next(); Map<String,Object> config = new HashMap<String,Object>(); // add some params to config … Framework fwk = ff.newFramework(config); fwk.start(); The OSGi framework is now running. Since Framework extends Bundle you can call getBundleContext and call … Read more

What does OSGi solve?

what benefits does OSGi’s component system provide you? Well, Here is quite a list: Reduced Complexity – Developing with OSGi technology means developing bundles: the OSGi components. Bundles are modules. They hide their internals from other bundles and communicate through well defined services. Hiding internals means more freedom to change later. This not only reduces … Read more

Reading my own Jar’s Manifest

You can do one of two things: Call getResources() and iterate through the returned collection of URLs, reading them as manifests until you find yours: Enumeration<URL> resources = getClass().getClassLoader() .getResources(“META-INF/MANIFEST.MF”); while (resources.hasMoreElements()) { try { Manifest manifest = new Manifest(resources.nextElement().openStream()); // check that this is your manifest and do what you need or get the … Read more