Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Restart after an update?
Restart after an update? [message #523513] Fri, 26 March 2010 12:28 Go to next message
Roel De Nijs is currently offline Roel De Nijs
Messages: 28
Registered: March 2010
Junior Member
Hi,

We have an Eclipse RCP product (application) and we need an automatic update mechanism which updates our application at startup. To fulfill this requirement we use the code found on this link.

This code worked well, but now we are experiencing some weird behavior: when I export the product, I'm able to run the application. Then I build a new update site, so a new update becomes available (the version of our custom plugins are defined as 1.0.0.qualifier). Then I start the application again, the automatic update manager notices the updates and retrieves the update jar files and then I expect a restart, but that does not happen every time, so the updates are not visible. When I restart the application again, I get thes exceptions:


!ENTRY org.eclipse.osgi 2 0 2010-03-26 17:18:47.062
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-03-26 17:18:47.062
!MESSAGE Bundle be.aclvb.client.application_1.0.0.201003161350 [2] was not resolved.
!SUBENTRY 2 be.aclvb.client.application 2 0 2010-03-26 17:18:47.062
!MESSAGE Another singleton version selected: be.aclvb.client.application_1.0.0.201003161351
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-03-26 17:18:47.062
!MESSAGE Bundle be.aclvb.framework.client_1.0.0.201003161350 [3] was not resolved.
!SUBENTRY 2 be.aclvb.framework.client 2 0 2010-03-26 17:18:47.062
!MESSAGE Another singleton version selected: be.aclvb.framework.client_1.0.0.201003161351
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-03-26 17:18:47.062
!MESSAGE Bundle be.aclvb.leden.client_1.0.0.201003161350 [10] was not resolved.
!SUBENTRY 2 be.aclvb.leden.client 2 0 2010-03-26 17:18:47.062
!MESSAGE Another singleton version selected: be.aclvb.leden.client_1.0.0.201003161351

I tried it also with a demo-project (the mail application) and I experienced the same weird behavior.
I don't have any clue about why the SiteManager.getLocalSite().save() method does not return always true when updates are found, that's what I would expect (every custom plugin has a higher version than the current one)

Any comments, suggestions or tips are highly appreciated.
Kind regards,
Roel
Re: Restart after an update? [message #523521 is a reply to message #523513] Fri, 26 March 2010 12:54 Go to previous messageGo to next message
Vimal G is currently offline Vimal G
Messages: 5
Registered: March 2010
Location: Pune
Junior Member
Hi,Roel

I have also done a similar kind of stuff for my current project.

I am not much sure, but what I could figure out is there are two versions of the plugin (e.g.be.aclvb.client.application_1.0.0.201003161350 and be.aclvb.client.application_1.0.0.201003161351 , be.aclvb.framework.client_1.0.0.201003161350 and be.aclvb.framework.client_1.0.0.201003161351 )
So whenever the application starts up the equinox launcher is unable to resolve them. So the solution could be to remove the previous version from the current configuration. So in your code try to include the feature removal for the previous features installed. Using the same factory i.e. OperationsManager.getOperationFactory().
Upon changed the configuration you can see the removed features in the "platform.xml" file. ("list" attribute of the <site> tag).

Hope this could be useful. you can contact me on my mail.

Regards,


Vimal G.
Programmer Analyst,
CTS, Pune
Re: Restart after an update? [message #523802 is a reply to message #523521] Mon, 29 March 2010 04:02 Go to previous messageGo to next message
Christian is currently offline Christian
Messages: 72
Registered: July 2009
Member
Am 26.03.2010 17:54, schrieb Vimal G:
> Hi,Roel
>
> I have also done a similar kind of stuff for my current project.
>
> I am not much sure, but what I could figure out is there are two
> versions of the plugin
> (e.g.be.aclvb.client.application_1.0.0.201003161350 and
> be.aclvb.client.application_1.0.0.201003161351 ,
> be.aclvb.framework.client_1.0.0.201003161350 and
> be.aclvb.framework.client_1.0.0.201003161351 )
> So whenever the application starts up the equinox launcher is unable to
> resolve them. So the solution could be to remove the previous version
> from the current configuration. So in your code try to include the
> feature removal for the previous features installed. Using the same
> factory i.e. OperationsManager.getOperationFactory().
> Upon changed the configuration you can see the removed features in the
> "platform.xml" file. ("list" attribute of the <site> tag).
>
> Hope this could be useful. you can contact me on my mail.
>
> Regards,
>

wouldn't the error imply that it would be better to change the version
numbers of the plugins/features ... after all that date qualifier is
afaik ignored ... so for rcp those plugins look the same ..
Re: Restart after an update? [message #523834 is a reply to message #523513] Mon, 29 March 2010 10:51 Go to previous messageGo to next message
Roel De Nijs is currently offline Roel De Nijs
Messages: 28
Registered: March 2010
Junior Member
Hi Vimal,

First of all thanks for your swift reply.

I have changed the policy to MANAGED-ONLY (according to the documentation only plugins from the features define by this site are run). So why eclipse is trying to load other plugins (with a lower version) is a complete mistery to me Confused

When I use the default policy (USER-EXCLUDE) the platform.xml is updated correctly (without any code change, so I don't think the code change you mentioned is necessary). It looks like this
list="plugins/be.aclvb.framework.common_1.0.0.201003291609.jar,
plugins/be.aclvb.leden.client_1.0.0.201003291609.jar,
plugins/be.aclvb.client.application_1.0.0.201003291609.jar,
plugins/be.aclvb.framework.client_1.0.0.201003291609.jar,
plugins/be.aclvb.leden.common_1.0.0.201003291609.jar"
policy="USER-EXCLUDE"

And the feature is also updated correctly to the next version (version="1.0.0.201003291618"), but for some (unknown) reason eclipse tries to resolve the "old" bundles (jars).

If you start the console and run ss, i'll see the following:
- the old bundles (previous version) have status installed Confused
- the new bundles (next version, from update) have status active or lazy
I don't have any clue about this (in my opinion) strange behavior.

Kind regards,
Roel
Re: Restart after an update? [message #523837 is a reply to message #523802] Mon, 29 March 2010 10:56 Go to previous message
Roel De Nijs is currently offline Roel De Nijs
Messages: 28
Registered: March 2010
Junior Member
Christian wrote on Mon, 29 March 2010 04:02

wouldn't the error imply that it would be better to change the version
numbers of the plugins/features ... after all that date qualifier is
afaik ignored ... so for rcp those plugins look the same ..

According to the implementation of method PluginVersionIdentifier.isGreaterThan(PluginVersionIdentifie r id) all parts (even the qualifier one) are taken into account to check if a feature/plugin has a greater version than another feature/plugin.
If this wouldn't work, I would not be able to update and the update process works as expected: available update is noticed, necessary files are downloaded and adjustments to plugin.xml are made. The only question still standing: why does eclipse keep loading the old versions of these plugins.

Kind regards,
Roel

[Updated on: Mon, 29 March 2010 10:57]

Report message to a moderator

Previous Topic:How to? / RCP with service plug-in and EJB3 interaction
Next Topic:IProgressMonitor report error to user
Goto Forum:
  


Current Time: Thu Jul 31 01:35:42 EDT 2014

Powered by FUDForum. Page generated in 0.02500 seconds