I am trying to run a simple app using the procedure outlined in this tutorial: BndTools tutorial project.
And this is the osgi project/module I am trying to load.
package com.counter;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
import org.osgi.framework.BundleListener;
public class BundleCounterActivator implements BundleActivator,
BundleListener{
private BundleContext context;
public void start(BundleContext context) throws Exception{
this.context=context;
context.addBundleListener(this);
printBundleCount();
}
public void stop(BundleContext context)throws Exception{
context.removeBundleListener(this);
}
public void bundleChanged(BundleEvent event){
switch(event.getType()){
case BundleEvent.INSTALLED:
System.out.println("Bundle Installed");
printBundleCount();
break;
case BundleEvent.UNINSTALLED:
System.out.println("Bundle Uninstalled");
printBundleCount();
break;
}
}
private void printBundleCount(){
int count=context.getBundles().length;
System.out.println("There are currently" +count+ " bundles");
}
}
This is the bnd.bnd file I have for the package containing the BundleCounterActivator class.
Bundle-Version: 0.0.0.${tstamp}
Private-Package: \
com.counter
Bundle-Activator: com.counter.BundleCounterActivator
I am trying to upload this bundle to the 'run bundle' configuration defined in the tutorial. However, I get the following error:
Unable to resolve BundleCounter version=0.0.0.201508121544:
missing requirement Require[osgi.wiring.package]{}{filter=(&(osgi.wiring.package=org.osgi.framework)
My question: How do I install the missing package: 'org.osgi.framework' for this project (or rather, the felix osgi runtime environment setup for the tutorial project in the given link) ? Any help is appreciated.
Here are the screenshots for the steps involved: