install of plugins is not persistent

Description

I created an installation package from the actual developer version (using Eclipse Luna). Then I installed that and started the server. Then I used the OSGi console (on port 12612) to install a new plugin. The plugin worked and everything seemed ok. But after a restart of the server the plugin was gone. The same issue is when I use the Apache Felix console to install the plugin. - it works, but after a server restart it is like it has never been there.

It seems that the bug was introduced between 2.1 and 3.0/developer. Perhaps it has to do with the many changes around the platform upgrade (IDEMPIERE-2245).

(I did not try if the problem is there when you use the jenkins daily snapshot installer.)

Environment

None

Activity

Show:
Thomas Bayen
April 3, 2015, 1:54 PM

Research

I did some research. I have to say that I am not the best friend of all this Equinox/OSGi stuff. Please be patient if I explain things wrong or too slow. (It seems for me that Equinox/P2/Director are desperately bad documented when you do not use them to extend Eclipse itself. If someone can point me to a good introduction please tell me.)

My idea was that the new installed bundle is there until the point when I start the server (I can find it in the filesystem but after the restart it is deleted). Something in the startup process deletes all plugins that are not part of the standard installation.

The startup of the Equinox Framework is to be configured in a file named configuration/config.ini. There is an entry that is named osgi.bundles. According to the Eclipse documentation for runtime options that is used to name all bundles that will be loaded when the framework starts. In former times (afair until iDempiere 2.1) there was a list of all installed bundles (that was a quite long text line).

In my actual package I had the following two lines in config.ini:

The mentioned file bundles.info contains a list of all standard bundles.

It seems that someone changed the way of loading all bundles from "having a list of bundles in config.ini" to "using the SimpleConfigurator and having a list of bundles in a separate file bundles.info".

I found no good documentation of the SimpleConfigurator class (only a bit here - but did I mention already that there is no good documentation of Equinox...). I found the source code of the SimpleConfigurator Activator and it says that there is a property PROP_KEY_EXCLUSIVE_INSTALLATION that is a switch to delete every plugin that is not in the bundles.info file. You can check this behaviour in the applyConfiguration() method. The String value of PROP_KEY_EXCLUSIVE_INSTALLATION is org.eclipse.equinox.simpleconfigurator.exclusiveInstallation.

Workaround

Adding this line to configuration/config.ini solves the issue:

What to do?

I have no clue how the config.ini file in the idempiere installation package is created. I am sure that it is a very small source code patch to include this single line in the created installation package.

I would expect that config.ini is created using the informations in org.adempiere.server-feature/server.product but that seems not the case. In this file some Properties are defined that should go into config.ini but I can't find them in the resulting file. There is also a launch configuration named server.product that is (for me) a candidate to set informations for the buckminster Action (there is a "Configuration" tab). But there I can not configure my own properties. And the checkbox "Support software installation in the launched application" seems to have more complicated consequences (according to documentation I found it includes the p2 director and other stuff).

Thomas Bayen
April 3, 2015, 2:07 PM

I can confirm that the config.ini of 3.0 file in jenkins looks the same as my self-created version. (For me that means that this issue does not belong to the Eclipse version I used.) You can see the older version (with the veery long line) also on jenkins at config.ini of 2.1.

While reading the sources of the SimpleConfigurator I wonder if it is still possible to update the iDempiere server (using the ./update.sh skript) without my workaround. I would bet that the updated bundles will also be deleted with the next server restart.

Hiep Lq
August 22, 2015, 3:12 PM

Hi config.ini is auto create by package process.
all bundle has start level >= start level of simpleconfigurator will write to bundles.info file. other will at online.

i download start kit at http://download.eclipse.org/equinox/drops/R-LunaSR2-201502041700/download.php?dropFile=EclipseRT-OSGi-StarterKit-LunaSR2-linux-gtk-x86_64.tar.gz
at first, i install a bundle and restart, my installed bundle still there. don't delete.
by debug. i can understand logic. i just manual add a bundle to bundles.info and after restart, installed bundle is deleted same at idempiere.

i think configuration you are suggested is correct method, follow it, i add a patch at ticket IDEMPIERE-2770

Assignee

Hiep Lq

Reporter

Thomas Bayen

Labels

None

Tested By

None

Affects versions

Priority

Blocker
Configure