Search code examples
javaeclipseeclipse-plugineclipse-rcpe4

How to add dependencies to an Eclipse e4 RCP application?


I'm developing an Eclipse e4 RCP application and want to use the Jersey REST client to call a RESTful webservice, but when I add the dependencies to the plugin MANIFEST.MF file the application fails to start correctly.

The dependencies I want to add are javax.ws.rs, org.glassfish.jersey.core.jersey-client and org.glassfish.jersey.media.jersey-media-json-jackson. All three have been added to the target definition file which are being downloaded from Eclipse Orbit (so they already include the necessary OSGI information) and the plugin MANIFEST.MF file.

The project is comprised of two plugin modules, a feature module which specifies the two plugins, a product module which specifies the feature, and a target definition module. The first plugin is com.xxx.application and is main application. The second plugin is com.xxx.demo and provides a part for the main application. It is the second plugin which I'm trying to add the dependencies.

When I try to start the application via the product file, the following error message is returned...

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-05-02 14:52:36.033
!MESSAGE Unable to retrieve the bundle from the URI: bundleclass://com.xxx.demo/com.xxx.demo.DemoPart

The problem seems to occur the moment any of the three dependencies are added to the com.xxx.demo plugin's MANIFEST.MF file and if I remove the dependencies from the MANIFEST.MF file it starts correctly. I haven't included any of the JAX-RS code in the plugin which would call the web service, so I know the problem is triggered when I add the dependencies to the manifest file.

Is there something I've missed in setting up the dependencies which is preventing the application from starting or alternatively is there a better way add dependencies to a plugin?


Solution

  • The MANIFEST.MF for a plugin generally only has to list other plugins it depends on directly.

    When using a feature based .product file the feature.xml files in the product must list every single plugin that is required in the RCP. If something isn't listed it won't be included.