HI All,
I am having some problem with system bundle not exporting packages correctly.
Current Setup :
*Osgi framework embedded inside an existing server application. ApplicationServer is started in spring-like manner.
*Osgi framework programmatically started as part of a Spring bean initalisation. Logs report fmk started ok and systembundle ACTIVE. However when I inspect exported packages in fmk, none is exported by system bundle.
osgi> ss
Framework is launched.
id State Bundle
0 ACTIVE org.eclipse.osgi_3.5.1.R35x_v20090827
osgi> packages 0
No exported packages
My code:
//Called as part of Spring Bean init
public void initialise() {
logger.info("Starting OSGI framework");
FrameworkFactory frameworkFactory = ServiceLoader.load(FrameworkFactory.class).iterator().next();
Map<String, String> config = new HashMap<String, String>();
config.put("osgi.console", "1234");
config.put(Constants.FRAMEWORK_STORAGE, "osgilogs/");
config.put(Constants.FRAMEWORK_STORAGE_CLEAN, "onFirstInit");
Framework framework = frameworkFactory.newFramework(config);
try {
framework.start();
} catch (BundleException e) {
logger.error("Fail to start osgi framework.", e);
}
logger.info("OSGI started");
}