2
votes

In AEM servlet, I have set the four default values of OSGI configuration. First time when I build the project, In Felix console, I can see four osgi configurations. But once I update the configurations, following scenarios are happening. Can somebody please confirm if this is the way OSGI works.

  1. Once I update/delete the configurations (atleast one config is there), and if I build again, default values are not getting restored. It remains in the previous modified state. I think is the correct behavior. Please confirm.

  2. Since this is of type array, when I delete all the default configurations from Felix console, and if I build again, then default values are getting restored. This behavior is different than above scenario. Why is this so?

    @Property(value={"gophone", "mobile", "tablet", "desktop"}, unbounded = PropertyUnbounded.ARRAY, cardinality=50, label = "Blocked urls", description = "Blocked urls") private static final String URLS_LIST = "blockedUrls";

1

1 Answers

1
votes

When you change the OSGI config from console, the new config will be stored in /apps/system/config/<your config PID>

so, scenario 1 is the correct behavior, if you modify OSGI config, then redeploy your servlet, the new config is persisted.

As for scenario 2, I dont think that's the case, when you empty the config and save it, it is stored as an empty config in /apps/system/config/<your config PID>and redeploying will not show the default value in osgi console. Check to see if the config file is removed after you remove all configs from osgi console.