Skip to main content



      Home
Home » Eclipse Projects » e(fx)clipse » Wrong bundle loaded after update on macosx
Wrong bundle loaded after update on macosx [message #1761260] Tue, 09 May 2017 08:14 Go to next message
Eclipse UserFriend
Hi,

This issue follows one we previously had about macosx bundling.

We were unable to create a .pkg installer using Tycho so we fInally, we gave up and ended doing the packaging "by hand".

So we have a exec-maven-project running a script like this :
#!/bin/sh

file_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )

if [ ! -d "$HOME/CNOP/FAST" ]; then

    mkdir -p $HOME/CNOP/FAST

fi

cd "$HOME/CNOP/FAST"

export applicationXMI='dp.fast.core.workbench/Application.e4xmi'

$file_path/../jre/bin/java -Dorg.osgi.framework.bundle.parent=ext -Dfile.encoding=UTF-8 -classpath $file_path/../Eclipse/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar org.eclipse.equinox.launcher.Main -product dp.fast.core.workbench.product -configuration file:$file_path/../Eclipse/configuration/ -os macosx -arch x86_64 -nl fr_FR -noSplash -clearPersistedState

# -DforceDebug=true -Dmode=dev -debug  -consoleLog



Which is packaged using native pkgbuild to produce a working installer:
pkgbuild --identifier dp.fast.app --root ../target/dp.fast.product-mac/dp.fast.product/ --install-location /Applications ../../dp.fast/deploy/Fast.pkg


But problem comes later.

We use the standard UpdateService which is working correctly. The app loads new stuff from repository and put it in app/plugins directory, so we end up having in this directory both versions of each of our plugins (say versions 1 and 2).

On windows, when the app starts, it picks up the correct version of the plugins (version 2), but on mac, it keeps loading the wrong one (version 1). If i delete all v1 jars, it picks up the correct ones (v2 obviously) but if i then undelete them (so we now have back v1 and V2), it keeps taking v2.

Is it a known issue? How does equinox choose which jar to load when there are several availables?
Maybe we miss a parameter from our custon packager command line?

Thanks for help.
Re: Wrong bundle loaded after update on macosx [message #1761319 is a reply to message #1761260] Tue, 09 May 2017 12:14 Go to previous messageGo to next message
Eclipse UserFriend
p2 is responsible for that but i'm sure the information is stored somewhere in the configuration directory - a guess is that this is a problem with rights. Is your application signed?
Re: Wrong bundle loaded after update on macosx [message #1761357 is a reply to message #1761319] Wed, 10 May 2017 03:48 Go to previous messageGo to next message
Eclipse UserFriend
No it isn't.
Re: Wrong bundle loaded after update on macosx [message #1763408 is a reply to message #1761357] Mon, 15 May 2017 09:12 Go to previous messageGo to next message
Eclipse UserFriend
Can you point me some classes or files i should have a look at ?
Re: Wrong bundle loaded after update on macosx [message #1763421 is a reply to message #1763408] Mon, 15 May 2017 12:14 Go to previous messageGo to next message
Eclipse UserFriend
Would you be able to create a minimal example i could use to reproduce the problem? What happens if you don't package the app and try an update then?
Re: Wrong bundle loaded after update on macosx [message #1763447 is a reply to message #1763421] Tue, 16 May 2017 05:41 Go to previous messageGo to next message
Eclipse UserFriend
I am not sure i can create a minimal working example, it would be too complex, but maybe i will try later if i have time. And i dont really understand what your second sentence means.

But i noticed a difference between windows and mac in the file configuration\org.eclipse.equinox.simpleconfigurator\bundles.info (which, correct me if i am wrong, seems to describe the jars to load)

On windows, when i do the update, this file contains only the new version of the jars, ex:
dp.fast.app,2.0.1,plugins/dp.fast.app_2.0.1.jar,4,false
dp.fast.app.update,2.0.1,plugins/dp.fast.app.update_2.0.1.jar,4,false
dp.fast.app.workbench,2.0.1,plugins/dp.fast.app.workbench_2.0.1.jar,4,false
dp.fast.connector,2.0.1,plugins/dp.fast.connector_2.0.1.jar,4,false
dp.fast.core,2.0.1,plugins/dp.fast.core_2.0.1.jar,4,false
dp.fast.core.fx,2.0.1,plugins/dp.fast.core.fx_2.0.1.jar,4,false
....


But on mac, it contains both the old and the new version:
dp.fast.app,2.0.1,plugins/dp.fast.app_2.0.1.jar,4,false
dp.fast.app,2.0.0,plugins/dp.fast.app_2.0.0.jar,4,false
dp.fast.app.update,2.0.1,plugins/dp.fast.app.update_2.0.1.jar,4,false
dp.fast.app.update,2.0.0,plugins/dp.fast.app.update_2.0.0.jar,4,false
dp.fast.app.workbench,2.0.1,plugins/dp.fast.app.workbench_2.0.1.jar,4,false
dp.fast.app.workbench,2.0.0,plugins/dp.fast.app.workbench_2.0.0.jar,4,false
dp.fast.connector,2.0.1,plugins/dp.fast.connector_2.0.1.jar,4,false
dp.fast.connector,2.0.0,plugins/dp.fast.connector_2.0.0.jar,4,false
dp.fast.core,2.0.1,plugins/dp.fast.core_2.0.1.jar,4,false
dp.fast.core,2.0.0,plugins/dp.fast.core_2.0.0.jar,4,false
dp.fast.core.fx,2.0.1,plugins/dp.fast.core.fx_2.0.1.jar,4,false
dp.fast.core.fx,2.0.0,plugins/dp.fast.core.fx_2.0.0.jar,4,false
...


I guess the problem lays here. If i remove the lines containing the old version, the app correctly loads the new bundle (obvioulsy).

So what can create these double lines ?
Re: Wrong bundle loaded after update on macosx [message #1763504 is a reply to message #1763447] Tue, 16 May 2017 14:41 Go to previous messageGo to next message
Eclipse UserFriend
Right this file is written by p2 :-( so you need to ask at the p2 forums/mailing list
Re: Wrong bundle loaded after update on macosx [message #1763525 is a reply to message #1763504] Wed, 17 May 2017 01:16 Go to previous messageGo to next message
Eclipse UserFriend
Just a short question, not sure if it is related.

Do you use a plugin or a feature based product? I'm just asking to maybe get an idea what is going wrong. A feature is a singleton IU. That means if a new feature comes up, p2 will delete the old feature and the corresponding bundles. For a plugin based product it would be ok to start all the bundles in different versions. Well at least if the bundle is not marked as a singleton.

As I said, not sure if it is related, but could point to a direction that even helps the p2 experts.
Re: Wrong bundle loaded after update on macosx [message #1763540 is a reply to message #1763525] Wed, 17 May 2017 04:32 Go to previous message
Eclipse UserFriend
@Dirk
It is a feature based product.

@Tom
I will do that, thanks for your support.
Previous Topic:Don't have "Generate JavaFx getters and setters"
Next Topic:Synchronizing FXML/Controller automatically (New feature)
Goto Forum:
  


Current Time: Sat Jul 12 22:56:34 EDT 2025

Powered by FUDForum. Page generated in 0.47588 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top