Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » Can p2 dropins be used to update existing plugins?
Can p2 dropins be used to update existing plugins? [message #663902] Wed, 06 April 2011 14:42 Go to next message
Max Mising name is currently offline Max Mising name
Messages: 54
Registered: September 2010
Member
I am trying to get automated updating of specific plugins through the dropins and am having trouble. I have read about dropins being used to add new plugins but nothing about updating existing plugins. Will p2 dropins work for this? If not, what would the route be to get this working? We deliver our full application to our users via RPMs which they install and they need us to be able to provide patches to specific plugins or groups of plugins via RPMs as well. So I figured that our update RPMs would drop updated plugins into the dropins directory for auto updating next startup. Does anyone have any experience with this?

BTW (this might not be important but...) the application is shared application so multiple users run it from a shared mount point and none have write access to that specific directory.

Thanks

Max
Re: Can p2 dropins be used to update existing plugins? [message #664079 is a reply to message #663902] Thu, 07 April 2011 08:42 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

dropins was a functionality bridging mechanism to help out people in
eclipse 3.4, and is a best effort, optionally installing, silently
failing hack

dropins won't effectively update a bundle that's already in your eclipse
as part of a feature, because the dropins version is marked as optional
and the older one is required by the feature, so the dropins one is tossed.

I'd install new plugins or patches using p2 (either interactively
through Help>Update or Help>Install New Software) or through the p2
director (from scripts). Once you have the correct configuration
including your new patches, you can deliver that with the RPMs that are
doing the update, no?

I would also suggest asking on irc://freenode.net/#eclipse-linux ...
they have to package updates as RPMs.

Later,
PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Can p2 dropins be used to update existing plugins? [message #666558 is a reply to message #663902] Wed, 20 April 2011 20:37 Go to previous messageGo to next message
Justin is currently offline Justin
Messages: 7
Registered: September 2010
Junior Member
I'm glad I found this post; I was trying to use the dropins to do the same thing and failing. I assumed I misunderstood how it worked and this confirms that.

Is there another hack to make dropins support replacing a single plugin? I'd like the easiest possible way to patch bundles during development, not after a delivery. We have many applications installed, and it would be easiest to have them point at a shared directory.

We don't have any UI to support updates, so it would have to work headless. Is the director the best/only option? I'd like to be able to patch single bundles across many application installs, without updating a p2 site and adding self update.

Thanks for any insight,
Justin
Re: Can p2 dropins be used to update existing plugins? [message #666653 is a reply to message #666558] Thu, 21 April 2011 09:17 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 04/20/2011 08:37 PM, Justin wrote:
> Is there another hack to make dropins support replacing a single plugin?

No, that code is poison :-)

> We don't have any UI to support updates, so it would have to work
> headless. Is the director the best/only option? I'd like to be able to
> patch single bundles across many application installs, without updating
> a p2 site and adding self update.

The p2 director can be used to create installs of RCP apps and update
them, all without having any p2 code in the app itself. Or only the
most basic p2, like simpleconfigurator + support (that reads the
bundles.info), using an external director avoids dragging in
self-updating code that you don't need.

Building plugins can generate p2 metadata, in effect creating small p2
repos that can be distributed as a .zip (instead of making it a full
update site on http, for example).

But you still need an eclipse with p2 support somewhere, to manage the
installs if p2 is not really part of your apps.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Can p2 dropins be used to update existing plugins? [message #666695 is a reply to message #666653] Thu, 21 April 2011 12:45 Go to previous messageGo to next message
Max Mising name is currently offline Max Mising name
Messages: 54
Registered: September 2010
Member
so what would be the bare minimum p2 plugins required to include with my app if I wanted to use the director to update my plugins/features using my app's executable? We are using the simpleconfigurator to load the required plugins. Also, if I am using the director to do updates, does that mean I have to still set these in my build.properties when building my app:

p2.gathering=true
generate.p2.metadata = true
p2.metadata.repo=file:${buildDirectory}/repo
p2.artifact.repo=file:${buildDirectory}/repo
p2.flavor=tooling
p2.publish.artifacts=true

or would I just need generate.p2.metadata = true or any of them.


Thanks

Max
Re: Can p2 dropins be used to update existing plugins? [message #666703 is a reply to message #666695] Thu, 21 April 2011 13:50 Go to previous messageGo to next message
Justin is currently offline Justin
Messages: 7
Registered: September 2010
Junior Member
Our current app only has the RCP and the equinox executable features. As Paul mentioned, we install all of our application using the director, but we don't include any p2 features. I can't help with the PDE build part, since we use Buckminster, but as long as you end up with a p2 repo, the director should be able to install it.

Paul, thanks for the response. I guess I will try to script the use of the director to handle patches and rollbacks of the p2 profile.

Does using a bundle pool allow shared bundles to be updated in one place? I somehow doubt it since each application has its own p2 profile listing each bundle that is used, correct?

Thanks again,
Justin
Re: Can p2 dropins be used to update existing plugins? [message #666705 is a reply to message #666653] Thu, 21 April 2011 14:12 Go to previous messageGo to next message
Justin is currently offline Justin
Messages: 7
Registered: September 2010
Junior Member
Paul Webster wrote on Thu, 21 April 2011 09:17

Building plugins can generate p2 metadata, in effect creating small p2
repos that can be distributed as a .zip (instead of making it a full
update site on http, for example).




I just tried to build a single bundle and create the p2 metadata using the export wizard. I thought there was an option to "generate p2 metadata" in the wizard, but I don't see it anymore (I'm using 3.6.1). Is there an easy way to do this? The only options I can think of are using the publishers, either in ant or as the standalone applications, which is cumbersome if your target platform is set to something that doesn't include them.

Thanks,
Justin
Re: Can p2 dropins be used to update existing plugins? [message #666710 is a reply to message #666703] Thu, 21 April 2011 14:20 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 04/21/2011 01:51 PM, Justin wrote:
> Does using a bundle pool allow shared bundles to be updated in one
> place? I somehow doubt it since each application has its own p2 profile
> listing each bundle that is used, correct?

You can use the same bundle pool for all profiles and have the new
bundle in only one location ... but you would have to update each p2
profile with the new bundle.

Later,
PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Can p2 dropins be used to update existing plugins? [message #666711 is a reply to message #666705] Thu, 21 April 2011 14:39 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 04/21/2011 02:12 PM, Justin wrote:
>
> I just tried to build a single bundle and create the p2 metadata using
> the export wizard. I thought there was an option to "generate p2
> metadata" in the wizard, but I don't see it anymore (I'm using 3.6.1).
> Is there an easy way to do this? The only options I can think of are
> using the publishers, either in ant or as the standalone applications,
> which is cumbersome if your target platform is set to something that
> doesn't include them.

That option is on the Export>Feature panel, not the one for plugins and
fragments.

If you are only working with plugins, then you would need to use the
same eclipse that has your director to publish metadata about your
plugin (which it can do relatively quickly) and then you can install it
(although you might have to uninstall the existing one).

Is your RCP app feature based? Features tend to record the specific
versions of their plugins. To replace one plugin in a feature-based app
you need to provide a feature patch (a little project that specifically
lists your plugin).

We use that to do a form of continuous testing in our project. We
install eclipse, and then use a feature patch to replace that specific
plugin. The plus side, you can use File>Export...>Feature (on the
feature patch) and it will create the correct p2 data that allows for a
quick install of the feature.patch.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Can p2 dropins be used to update existing plugins? [message #666825 is a reply to message #666711] Fri, 22 April 2011 16:48 Go to previous messageGo to next message
Max Mising name is currently offline Max Mising name
Messages: 54
Registered: September 2010
Member
So I've got my application building properly and have moved to using the director to install and update my features. I am running into an issue now where I cannot install the pydev feature using the director due to untrusted jar signatures. Here is a link on it in pydev, apparently they think it is eclipse's job to allow untrusted signed jars to be installed with the director. http://sourceforge.net/tracker/index.php?func=detail&aid =3097682&group_id=85796&atid=577329

Is there any way to circumvent the security checking on the signing and force the installation of pydev?

Edit: Here is some error output:



Problems downloading artifact: osgi.bundle,org.python.pydev,1.6.5.2011020317.
Error reading signed content:/tmp/signatureFile8739107837822520481.jar
Caused by: java.security.SignatureException: An error occurred while processing the signatures for the file: /tmp/signatureFile8739107837822520481.jar
Caused by: java.security.SignatureException: Either the manifest file or the signature file has been tampered in this jar: /tmp/signatureFile8739107837822520481.jar
Problems downloading artifact: osgi.bundle,org.python.pydev.ast,1.6.5.2011020317.
Error reading signed content:/tmp/signatureFile6536737159620387686.jar
Caused by: java.security.SignatureException: An error occurred while processing the signatures for the file: /tmp/signatureFile6536737159620387686.jar
Caused by: java.security.SignatureException: Either the manifest file or the signature file has been tampered in this jar: /tmp/signatureFile6536737159620387686.jar
Problems downloading artifact: osgi.bundle,org.python.pydev.core,1.6.5.2011020317.
Error reading signed content:/tmp/signatureFile7873137977705228276.jar
Caused by: java.security.SignatureException: An error occurred while processing the signatures for the file: /tmp/signatureFile7873137977705228276.jar
Caused by: java.security.SignatureException: Either the manifest file or the signature file has been tampered in this jar: /tmp/signatureFile7873137977705228276.jar
Problems downloading artifact: osgi.bundle,org.python.pydev.jython,1.6.5.2011020317.
Error reading signed content:/tmp/signatureFile3328232955984746023.jar
Caused by: java.security.SignatureException: An error occurred while processing the signatures for the file: /tmp/signatureFile3328232955984746023.jar
Caused by: java.security.SignatureException: Either the manifest file or the signature file has been tampered in this jar: /tmp/signatureFile3328232955984746023.jar
Problems downloading artifact: osgi.bundle,org.python.pydev.parser,1.6.5.2011020317.
Error reading signed content:/tmp/signatureFile4906840496634795862.jar
Caused by: java.security.SignatureException: An error occurred while processing the signatures for the file: /tmp/signatureFile4906840496634795862.jar
Caused by: java.security.SignatureException: Either the manifest file or the signature file has been tampered in this jar: /tmp/signatureFile4906840496634795862.jar
An error occurred while collecting items to be installed

org.eclipse.osgi Either the manifest file or the signature file has been tampered in this jar: /tmp/signatureFile4906840496634795862.jar
java.security.SignatureException: Either the manifest file or the signature file has been tampered in this jar: /tmp/signatureFile4906840496634795862.jar
at org.eclipse.osgi.internal.signedcontent.SignatureBlockProces sor.verifyManifestAndSignatureFile(SignatureBlockProcessor.j ava:154)
at org.eclipse.osgi.internal.signedcontent.SignatureBlockProces sor.processSigner(SignatureBlockProcessor.java:104)
at org.eclipse.osgi.internal.signedcontent.SignatureBlockProces sor.process(SignatureBlockProcessor.java:60)
at org.eclipse.osgi.internal.signedcontent.SignedBundleFile.set BundleFile(SignedBundleFile.java:47)
at org.eclipse.osgi.internal.signedcontent.SignedBundleHook.get SignedContent(SignedBundleHook.java:247)
at org.eclipse.equinox.internal.p2.artifact.repository.Signatur eVerifier.verifyContent(SignatureVerifier.java:77)
at org.eclipse.equinox.internal.p2.artifact.repository.Signatur eVerifier.verify(SignatureVerifier.java:59)
at org.eclipse.equinox.internal.p2.artifact.repository.Signatur eVerifier.close(SignatureVerifier.java:100)
at org.eclipse.equinox.internal.p2.artifact.repository.simple.S impleArtifactRepository.reportStatus(SimpleArtifactRepositor y.java:906)
at org.eclipse.equinox.internal.p2.artifact.repository.simple.S impleArtifactRepository.downloadArtifact(SimpleArtifactRepos itory.java:510)
at org.eclipse.equinox.internal.p2.artifact.repository.simple.S impleArtifactRepository.getArtifact(SimpleArtifactRepository .java:576)
at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRe quest.getArtifact(MirrorRequest.java:248)
at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRe quest.transferSingle(MirrorRequest.java:223)
at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRe quest.transfer(MirrorRequest.java:179)
at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRe quest.perform(MirrorRequest.java:115)
at org.eclipse.equinox.internal.p2.artifact.repository.simple.S impleArtifactRepository.getArtifact(SimpleArtifactRepository .java:565)
at org.eclipse.equinox.internal.p2.artifact.repository.simple.S impleArtifactRepository.getArtifacts(SimpleArtifactRepositor y.java:616)
at org.eclipse.equinox.internal.p2.engine.DownloadManager.fetch (DownloadManager.java:88)
at org.eclipse.equinox.internal.p2.engine.DownloadManager.start (DownloadManager.java:77)
at org.eclipse.equinox.internal.p2.engine.phases.Collect.comple tePhase(Collect.java:76)
at org.eclipse.equinox.internal.p2.engine.Phase.postPerform(Pha se.java:216)
at org.eclipse.equinox.internal.p2.engine.Phase.perform(Phase.j ava:84)
at org.eclipse.equinox.internal.p2.engine.PhaseSet.perform(Phas eSet.java:44)
at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine .java:73)
at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine .java:44)
at org.eclipse.equinox.internal.provisional.p2.director.PlanExe cutionHelper.executePlan(PlanExecutionHelper.java:41)
at org.eclipse.equinox.internal.provisional.p2.director.PlanExe cutionHelper.executePlan(PlanExecutionHelper.java:23)
at org.eclipse.equinox.internal.p2.director.app.DirectorApplica tion.executePlan(DirectorApplication.java:575)
at org.eclipse.equinox.internal.p2.director.app.DirectorApplica tion.planAndExecute(DirectorApplication.java:569)
at org.eclipse.equinox.internal.p2.director.app.DirectorApplica tion.performProvisioningActions(DirectorApplication.java:556 )
at org.eclipse.equinox.internal.p2.director.app.DirectorApplica tion.run(DirectorApplication.java:807)
at org.eclipse.equinox.internal.p2.director.app.DirectorApplica tion.start(DirectorApplication.java:961)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

Max

[Updated on: Fri, 22 April 2011 16:52]

Report message to a moderator

Re: Can p2 dropins be used to update existing plugins? [message #666992 is a reply to message #666825] Mon, 25 April 2011 07:48 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 04/22/2011 04:48 PM, Max wrote:
> So I've got my application building properly and have moved to using the
> director to install and update my features. I am running into an issue
> now where I cannot install the pydev feature using the director due to
> untrusted jar signatures. Here is a link on it in pydev, apparently they
> think it is eclipse's job to allow untrusted signed jars to be installed
> with the director.
> http://sourceforge.net/tracker/index.php?func=detail&aid =3097682&group_id=85796&atid=577329
>


Right now the only workaround is to add the untrusted CA cert to your
keystore:
http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/keytool .html#cacerts ...
now it's trusted and consumers can install from it.

The state of the system:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=340345


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Can p2 dropins be used to update existing plugins? [message #667407 is a reply to message #666992] Thu, 28 April 2011 10:55 Go to previous messageGo to next message
Max Mising name is currently offline Max Mising name
Messages: 54
Registered: September 2010
Member
EDIT: I may have spoke too soon earlier, it does look like the installation is making it all the way to SignedBundleFile.determineTrust which gets the trust engines from SignedBundleHook.getTrustEngines() and is calling findTrustAnchor(...) on the KeyStoreTrustEngine. which calls store.getCertificateAlias(rootCert) and is returning null. I was given the certificate by pydev and imported it using "keytool -import -file pydev_certificate.cer -keystore lib\security\cacerts". Was the the incorrect place to import the certificate? Do I need to alias it?

EDIT 2: I got it working, for some reason, I couldn't get the keystore path working but when I went into lib/security/cacerts myself I was able to add the certificate. So now that the certificate issue is all worked out, this should be the last bump. I've been testing by running the director out of eclipse (using my product file just with the program arguments:
-application org.eclipse.equinox.p2.director -nosplash -destination /path/to/rcp/installation/ -repository file:///path/to/my/feature/repo/ -i com.abc.def.feature.group/<version>

because when I run with the same arguments after my application has been installed, I get this exception. I originally decided to run out of eclipse to I could easily debug why it wasn't working and then realized it somehow works from there. Any ideas? I'm guessing I'm missing a plugin or something but I can't be certain since it all works when I run from eclipse.

INFO 2011-04-28 11:15:23,581 [Start Level Event Dispatcher] ExtenderConfiguration: No custom extender configuration detected; using defaults...
org.eclipse.osgi Application error
java.lang.NullPointerException: A null service reference is not allowed.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.g etService(BundleContextImpl.java:660)
at org.eclipse.equinox.internal.p2.director.app.DirectorApplica tion.initializeServices(DirectorApplication.java:426)
at org.eclipse.equinox.internal.p2.director.app.DirectorApplica tion.run(DirectorApplication.java:802)
at org.eclipse.equinox.internal.p2.director.app.DirectorApplica tion.start(DirectorApplication.java:961)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)


Thanks

Max

[Updated on: Thu, 28 April 2011 12:24]

Report message to a moderator

Re: Can p2 dropins be used to update existing plugins? [message #667438 is a reply to message #667407] Thu, 28 April 2011 14:20 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

p2 repos only contain .jar or .jar.pack.gz files. They're not part of
an install. Installing from a p2 repo will respect the unpack=true of
their containing feature.

Are you saying you are installing/creating the pydev plugins, and then
using the install to create a p2 repo containing them? If you need them
in your final repo, you should have a step that takes them from before
you install them and channel them directly into your final p2 repo.
That's assuming I've understood your build steps correctly.

ex: we use p2 repos of 3.7 I builds (and a few other repos) to create a
repo2runnable target for our PDE build. When we go to create our final
repo, we mirror from the original 3.7 I build repo we started with (so
as to not lose any metadata already in their repo). We don't take our
repo2runnable target and try and re-create the parts of the 3.7 repo we
need.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Previous Topic:p2 instal limits?
Next Topic:Bundle Start Level
Goto Forum:
  


Current Time: Wed Jul 23 20:18:46 EDT 2014

Powered by FUDForum. Page generated in 0.02041 seconds