Closed fipro78 closed 2 years ago
For Felix the system property
-Dorg.osgi.framework.storage.clean=onFirstInit
should clean the persistence on start. For Equinox I assumed-clean
should do the same.
org.osgi.framework.storage.clean=onFirstInit
is a standard OSGi property that should work across both Felix and Equinox.
At least for Felix, I don't think org.osgi.framework.storage.clean
works as a system property. It will work if used as a framework property.
In other words, for Felix, I think you need to pass it as an argument to the Atomos launcher - i.e., something like:
java -cp "bundles/*" org.apache.felix.atomos.Atomos org.osgi.framework.storage.clean=onFirstInit
The issue is Atomos main does not understand -clean
argument for the equinox case. For the org.osgi.framework.storage.clean
property, that is a framework launch option. Frameworks are not obligated to read that from the System properties. Only from the Map of properties passed to org.osgi.framework.launch.FrameworkFactory.newFramework(Map<String, String>)
is able to set that. As Karl says you can pass that as (non -D) arguments to Atomos main. See org.apache.felix.atomos.Atomos.main(String...)
Everyday I learn a new detail. Thanks for the explanation. I will verify tomorrow and give a feedback here.
Btw, the system property works with the Felix launcher. Probably that is why I thought it should also work with atomos this way.
@fipro78, right - that is done by the Felix main [0]. The framework is only using the framework properties.
Hi,
just in case someone is coming across this issue in the future, I can confirm that:
org.osgi.framework.storage.clean=onFirstInit
needs to be passed as argument to the Atomos launcher as described by @karlpauls clean
org.osgi.framework.storage.clean=onFirstInit
can be set as system propertyThanks @tjwatson and @karlpauls for the explanation.
Hi,
while investigating on the behavior of different OSGi runtimes I noticed that the persistence is never cleared when using Atomos.
Attached are two simple setups that use Atomos. The application is basically a Gogo Shell with some commands that use SCR, ConfigAdmin and EventAdmin to verify if things are working.
For Felix the system property
-Dorg.osgi.framework.storage.clean=onFirstInit
should clean the persistence on start. For Equinox I assumed-clean
should do the same.In both cases the persistence is never cleared. You can check this by starting the application and then call
fipro:configure <some_value>
. Then callfipro:welcome
which actually reads the configuration value and prints it to the console. Then stop the application and start it again. With the mentioned clean parameters thewelcome
command should printnull
, but it always prints the previously configure value. So the configuration persistence area is never cleared.folder_atomos_equinox.zip folder_atomos_felix.zip .