Development Tips

How do I start bundles automatically on startup of the OSGi framework?

Are you tired of starting all your bundles individually every time you start the framework?
If you have a number of bundles that you always require to be started, then you can add them to the Equinox configuration file located in the eclipse/configuration directory. The file is called config.ini and the property you need to add your bundles to is called osgi.bundles. Simply list all your bundles (as named in the MANIFEST.MF file as Bundle-SymbolicName) in the ':' (colon) separated list followed by '@start'

Eg. osgi.bundles=org.springframework.osgi@start:org.springframework.osgi.extender@start

Why is my workbench not loading?

Good question. One reason might be because the Echo2 library can not find an image resource that it's trying to load. Unfortunately when Echo2 loads images it usually enters an infinite wait state (with no time-out) until the image has loaded. If it can't find or load the image then the code waits forever. Check the log for trace messages.

Cooee or Workbench bundle not resolved

If you see the following message (where the import package either refers to a cooee or workbench package) when trying to start either the workbench or a workbench bundle,

org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Import-Package: .....

then it is because either the OSGi Cooee bundle or the workbench bundle itself is missing from your runtime environment. When you build a workbench bundle, maven will download these required bundles into your repository. These can both be found in your Maven repository at org/karora/cooee and org/karora/moomba respectively. You must copy these bundles into your Equinox runtime.

Why am I not seeing any of my workbench contributions?

There are many reasons why you may not be seeing any contributions in your workbench. Generally speaking if you see the message Couldn't find any IViewPart service references then this implies that the contributions have not been registered successfully as OSGi services. The service may not have been registered for several reasons. The bundle may not be installed correctly (i.e. the manifest file is not valid, imports can not be resolved, etc.). Also this can happen if the spring-osgi service declaration is either missing or invalid.

If you see the message No IViewPart service could be resolved then this means that the service was registered correctly, but could not be instantiated. This is very rare, but can happen if there is an error in the implementation of the service (in the case of the workbench this would be in the implementation of either the IPerspectiveFactory or IAction interfaces, or the extension of the ViewPart class).

Why is the workbench hanging?

This is probably due to an OSGi bundle waiting for a service that was not started. Check that all the bundles you require are resolved and active.

Labels

 
(None)