P2 and RCP Apps

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

This Post Has 12 Comments

  1. Michael Scharf

    Adding a plugin using the update manager is part of the tutorial Frank and I gave at eclipsecon (http://www.eclipsecon.org/2008/index.php?page=sub/&id=429)

    It failed for eclipse 3.3 due to problems with signed and unsigned plugins. It worked with older versions of eclipse.

    I must say I am pretty scared when it comes to eclipse 3.4 and provisioning. The update team is working day and night — but only 3 weeks to go. I hope the problems will be solved in 3.4.1 or 3.4.2….

  2. Pascal

    Lately, the PDE UI / p2 integration improved and you can now generate the complete metadata for a product directly from the IDE. Simply check the “generate metadata repository” option in the wizard page.

  3. Kai Tödter

    Thanks Pascal, that works very well with 3.4 RC3.

  4. DR

    So, what was the solution??? It’s annoying, when someone says “yep, it works”, but doesn’t explain how or why it does. I’ve got the same problem as the one described here, but I really can’t see how the responses give any solution to the problem.

  5. DR

    Found it for my case (had to step through pretty much the whole process…):

    My problem was that there was no ECF provider defined. The file existed, but ECF had no way of downloading it. So adding ECF provider bundles did the trick. I added:

    org.eclipse.ecf.provider.filetransfer

    And required plug-ins, and voila!

  6. Shawn

    Has anyone made a p2-ized RCP from a headless build? If so, do you have any pointers?

  7. philk

    This p2 looks awfully complex! Just for some update functionality?!

  8. scottyP

    I believe that p2 is a great framework for provisioning but what really frustrates me is that the p2 guys don’t think that an API, examples or something similar would be nice to have! People all over the world have now to work with their provisioning stuff but they make it really hard for developer to accept the new framework.

  9. Jason

    Maybe you can try Eclispe3.5 M6. 🙂

  10. parvez ahmad hakim

    Can some one upload sample projects for self-updates for the benefit of community. I am working on it since last 15 days, I used all the code above, but updates are not working.

  11. parvez ahmad hakim

    Can some one upload sample projects for self-updates for the benefit of community. I am working on it since last 15 days, I used all the code above, but updates are not working.

    How to update using update site.
    Can some one post detailed code .
    Below code is totally useless:- as it is incomplete
    http://www.ralfebert.de/blog/eclipsercp/p2_updates_tutorial/

Leave a Reply

I accept the Privacy Policy