Feb 6, 2008

Feature based configuration of an RCP application

For a RCP application, I started with plugins based product configuration. When I reached a point where I need to provide software updates thru an update site, I needed a feature based product configuration. I thought should be as simple as selecting the features check box and adding the feature. But I spent around two whole days googling and debugging to bring it up and running. I think everyone would have gone thru the phase. I thought I'll write a blog entry on the issues, but I was lazy to draft such a long post. Yesterday Jan Kohnert sent a nice mail on his experience to the news group. Instead of copy-pasting the whole thing here, I present the information with little modifications. Thanks Jan.



  • Open your product file and select features in the Overview tab:






  • In the Configuration tab, click "New Feature...", and create the new feature:




  • In the newly created feature, go to the included features tab and add "org.eclipse.rcp" feature:


  • Go to the plugins tab and add your product's plugins

  • RCP feature has most of the plugins that you would require. However if you use anything other plugins (core.resources, ui.forms, etc), you need to add those plugins to the feature:


At this point you should be successfully running your RCP application. If you are not interesting in providing support for Software Updates for your app, you should be fine with this.



Ideally, even for software updates, this should work fine. However, if you try to create an update site and try running software update, you will be hitting the java.lang.SecurityException: "Invalid signature file digest for Manifest main attributes". To get rid of that, remove the RCP feature from the included features list of your feature and add the plugins in RCP feature to your feature. Thanks to PDE team, copy-pasting works in the plugins tab of Feature Editor :-)







While going thru the update stuff, I realized that the update will not function as expected if we launch it from the IDE (Not sure of why). So I have to export the product and run from the disk, which means I can't debug and step thru the code :-( To know what happens during the update, I start the application with -debug options and add these lines in the .options file:



org.eclipse.update.core/debug=true

org.eclipse.update.core/debug/warning=true

org.eclipse.update.core/debug/parsing=true

org.eclipse.update.core/debug/install=true

org.eclipse.update.core/debug/configuration=true

org.eclipse.update.core/debug/type=true

org.eclipse.update.core/debug/web=true

org.eclipse.update.core/debug/installhandler=true

org.eclipse.update.core/debug/reconciler=true




Click here for more info on the .options

2 comments:

Anonymous said...

You can debug your exported RCP application using remote debugging. Google is your friend ;)

Ortegón said...

Quite useful, the step of adding the org.eclipse.rcp feature was not obvious at all. I was trying to add everything manually and I was walking into dependency hell.