Blog

RCP Self Provisioning with P2: It Works!!!

21

I finally could create the mail demo RCP app using p2 to update itself!
My environment is Windows Vista, Java 6, Eclipse 3.4 RC4.

Here are the steps that describe how I p2-enabled the mail demo:

1. Created the mail demo (project p2-maildemo)

2. Created a product configuration p2-maildemo.product

3. Added 3 plug-ins to both launcher and product configuration (and added required plug-ins)
– org.eclipse.equinox.p2.exemplarysetup
– org.eclipse.equinox.p2.ui.sdk
– org.eclipse.equinox.simpleconfigurator.manipulator

To get the final update work in the installed product, it is also necessary to include the following 3 plug-ins with dependencies in the product configuration:
– org.eclipse.ecf.provider.filetransfer
– org.eclipse.equinox.p2.touchpoint.eclipse
– org.eclipse.equinox.p2.touchpoint.natives

4. Exported the product and the metadata/artifact repositories to c:/java/RCP/p2-maildemo

5. Used the director app to install the mail demo from the repository, with the following Program arguments:
-application org.eclipse.equinox.p2.director.app.application
-metadataRepository file:c:/java/RCP/p2-maildemo/repository
-artifactRepository file:c:/java/RCP/p2-maildemo/repository
-installIU p2_maildemo.product
-version 1.0.0
-destination c:/java/RCP/p2-maildemo/install
-profile MaildemoProfile
-bundlepool c:/java/RCP/p2-maildemo/install
-profileProperties org.eclipse.update.install.features=true
-p2.os win32
-p2.ws win32
-p2.arch x86
-roaming
-consoleLog

VM arguments:
-Declipse.p2.data.area=c:/java/RCP/p2-maildemo/install/p2

6. Started the installed mail demo in c:/java/RCP/p2-maildemo/install

7. Selected Help/Software Updates…: Showed the P2 UI with installed Product in version 1.0.0

So far so good!

Now I wanted to create a new version 1.0.1 of the product and update the installed version 1.0.0:

8. Updated main mail demo plug-in to version 1.0.1

9. Updated product version to 1.0.1

10. Exported the new product version 1.0.1 in the SAME location, to update the metadata/artifact repositories.

The first thing I noticed was that my installed 1.0.0 did not find any update. I thought, when the installation repository contains a new version, this would be seen by my application without any extra configuration.

11. So I added the repository c:/java/RCP/p2-maildemo/repository manually as a new site, and voila, the new version 1.0.1 was displayed and ready for update.

12. When I wanted to install the update, the P2 dialog told me correctly: “RCP Product is already installed, so an update will be performed instead.”

13. And now, when I clicked finish, the update was actually happening, the new version was installed properly!!!

I am so happy that I finally got this to run 🙂

What would be the best practice to create a list of artifacts/metadata repositories in the configuration/.settings/org.eclipse.equinox.p2.metadata.repository.prefs and org.eclipse.equinox.p2.artifacts.repository.prefs to include the real update sites for the product?

Many thanks to everybody who helped me.

Kai

RCP Headless Build with PluginBuilder

6

One of my open action items for my MP3 Manager RCP Demo was to provide a headless build. It tried out PDE Build once and it worked great, but I had problems enabling the unit test runs. Recently I created a new project that uses PluginBuilder to generate the PDE build infrastructure. PluginBuilder is a great tool for easily setting up a PDE build structure for your RCP app and supports the integration of  SVN and CVS, as well as the integration of unit tests. Unfortunately, currently the RCP build only works with Eclipse 3.3.2, when using Eclipse 3.4, the executable is not generated but I hope that 3.4 will be supported when it is final.

P2 and RCP Apps

12

With every new 3.4 RC I try to p2-enable the mail demo application. I got many valuable tips from Pascal and I think, I am getting closer but I am not there yet :). Here is, what I did:

  • I created the mail demo from the wizard
  • I created a product configuration and included all the necessary p2 related plug-ins
  • Then I exported the app to my local file system
    (c:/java/RCP/examples/p2-maildemo)
  • The next step was to create a metadata and an artifact repository
  • I used Eclipse 3.4 RC3 and started an osgi app with the following parameters
    -console
    -consolelog
    -application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator
    -metadataRepository file:C:/java/test-install
    -artifactRepository file:C:/java/test-install
    -source c:/java/rcp/examples/p2-maildemo/eclipse
    -root Mail
    -rootVersion 1.0.0
    -flavor foobar
    -publishArtifacts
    -append
  • The repositories were successfully created
  • Then I installed the p2 agent 3.4 RC3
  • I created a new profile and installed the Mail application to a new installation location
  • I could successfully run newly installed Mail application 🙂 So far, so good

Now I want to install the application directly from Eclipse using the director application. I created a run configuration with the following argument:

-application org.eclipse.equinox.p2.director.app.application
-consoleLog
-flavor foobar
-installIU Mail
-version 1.0.0
-p2.os win32
-p2.ws win32
-p2.arch x86
-roaming
-profile MailProfile
-metadataRepository file:c:/java/test-install
-artifactRepository file:c:/java/test-install
-destination c:/java/rcp/test_install
-bundlepool c:/java/rcp/test_install
-vmargs
-Declipse.p2.data.area=C:/java/rcp/test_install/p2

It starts running but then I get errors:

!ENTRY org.eclipse.equinox.p2.metadata.repository 4 0 2008-06-03 16:33:30.177
!MESSAGE ProvisioningEventBus could not be obtained. Metadata caches may not be cleaned up properly.
Installing Mail 1.0.0.
Installation failed.

!ENTRY org.eclipse.equinox.p2.engine 4 4 2008-06-03 16:33:31.834
!MESSAGE An error occurred while collecting items to be installed
!SUBENTRY 1 org.eclipse.equinox.p2.artifact.repository 4 0 2008-06-03 16:33:31.834
!MESSAGE Problems downloading artifact: osgi.bundle,MailDemo,1.0.0.
!SUBENTRY 2 org.eclipse.equinox.p2.artifact.repository 4 0 2008-06-03 16:33:31.834
!MESSAGE Unable to read repository at file:c:/java/test-install/plugins/MailDemo_1.0.0.jar.
!SUBENTRY 2 org.eclipse.equinox.p2.artifact.repository 4 0 2008-06-03 16:33:31.834
!MESSAGE Unable to read repository at file:c:/java/test-install/plugins/MailDemo_1.0.0.jar.
!SUBENTRY 2 org.eclipse.core.runtime 0 0 2008-06-03 16:33:31.834
!MESSAGE OK
… many more similar errors

All the files that cannot be read actually exist. Here I am stuck and would appreciate any help.

Thanks

Kai

JSR 277 and OSGi ?

4

Last weekend I met with Geertjan from the NetBeans team and we had an interesting discussion about OSGi, the NetBeans module system and JSR 277. Geertjan showed me a blog entry of Mandy Chung, talking about interoperability of JSR 277 and OSGi. if you are interested in this topic, take a look at Mandy’s recent blog entry and also at the blog of Bryan Atsatt. What do you think?

Eclipse RCP vs. NetBeans Platform BOF @ JavaOne

0

Friday I got a mail from JavaOne saying that also my BOF Eclipse RCP vs. NetBeans Platform got accepted :). I will do the BOF together with Geertjan Wielenga from Sun. Since we won’t have too much time for discussion during the big technical session, the BOF will be a great opportunity to share experiences with both rich client platforms. The BOF will be Thursday, May 08, 6:30pm – 7:20pm.

Eclipse RCP @ JavaOne

1

I am very happy that my session “The NetBeans Platform Compared to the Eclipse Rich Client Platform” got accepted at this year’s JavaOne conference. This time I will give the session together with Geertjan Wielenga (from Sun’s NetBeans team), who will cover the NetBeans Platform while I can focus on the Eclipse Rich Client Platform.

Advanced RCP Tutorial Slides

0

Yesterday I gave a 2-hour tutorial about “Advanced Eclipse RCP” at the EclipseCon 2008 in Santa Clara. You can download the tutorial slides here (2.8 MB). All the source code for the demos you can get from the MP3 Manager project home page via anonymous svn access. I would like to thank everybody for the feedback, I am very pleased with the bucket results :).

Dynamic Language Switcher for Eclipse RCP Apps

6

People often ask me how to dynamically change the language in an Eclipe RCP application. I tried it out myselft and have to admit that it is not as easy as I would have expected. The problem is that PlatformUI.getWorkbench().restart() does not allow to set (or change) any new startup parameters, like -nl de. I have already filed a feature request for that (see 222023). The only workaround I found so far is to modify the product’s .ini file of the deployed RCP based product manually. Unfortunately I did not find a solution that works during development using launchers. I have implemented the dynamic language switcher in the plug-in com.siemens.ct.mp3m.language, see the project home page of the MP3 Manager demo (see http://max-server.myftp.org/trac/mp3m). Below is a screenshot showing the language menu:

language menu

A nice set of free flag icons you can find at
http://www.famfamfam.com/lab/icons/flags/.

New HTML Sitemap 1.3 available

2

I fixed a small bug to make the sitemap HTML 4.01 compliant. You can download the new version here.

Eclipse RCP Demo: MP3 Manager Update

13

I have added two new projects for my Eclipse RCP demo application MP3 Manager:

  • com.siemens.ct.mp3m.ui.editors.id3.databinding:
    This editor is very similar compared with the com.siemens.ct.mp3m.ui.editors.id3 editor but uses rudimentary Eclipse data binding. I did not add validation so far but I have planned that for future releases.
  • com.siemens.ct.mp3m.ui.cheatsheets:
    This bundle implements a little cheat sheet and provides help for adding and deleting music folders.

You find the project home page at max-server.myftp.org/trac/mp3m where you get the information for anonymous svn access.

Have Fun

Kai

Page 10 of 12« First...«89101112»