Hello again,

I've found out that if a configuration is initialized through a
sling:OsgiConfig node in a config.json file in /libs/myApp/install, the
configuration (even modified through the web console) is not removed by the
JCR Installer when I deploy another bundle.

If I'm right, it's explained by this line in the JCR Installer
documentation page [1] : "If a configuration is changed which already
exists in the repository, then it depends where the original configuration
is stored. If its under */libs* a new configuration at the same path under
*/apps* is created. Otherwise the configuration is directly modified"

Does it mean that I have to initialize every configuration that I have with
OsgiConfig nodes? I found it convenient to just put the Property annotation
in the services but I don't want my configuration to be deleted every time
I deploy a new bundle. Also, I've been able to set up sling:OsgiConfig
nodes for simple configuration, but it doesn't seem to work for
configuration factories.

Did someone else met the same issue?

Regards,
Guillaume

On Mon, Jul 4, 2016 at 10:37 AM, Guillaume Lucazeau <[email protected]>
wrote:

> Hello,
>
> When I deploy a bundle with a config.json file containing some osgi:config
> nodes, it deletes the configuration I saved for another bundle through the
> web console:
>
> First the property value declared by my first bundle is modified from the
> web console:
>
> INFO  c.r.o.c - Service 
> [c.r.o.c.services.models.components.ImageComponentServiceImpl,1410] 
> ServiceEvent UNREGISTERING
> INFO  c.r.o.c - Service 
> [c.r.o.c.services.models.components.ImageComponentServiceImpl,1451] 
> ServiceEvent REGISTERED
>
> When I deploy the second bundle with the Maven Sling plugin, the whole 
> configuration directory is deleted:
> INFO  o.a.s.i.p.jcr.impl.JcrInstaller - Removing resource from OSGi 
> installer: 
> [/apps/sling/install/c.r.o.c.services.models.components.ImageComponentServiceImpl.config]
> INFO  o.a.s.i.p.jcr.impl.JcrInstaller - Deleting 
> WatchedFolder:/apps/sling/install, path does not exist anymore
> INFO  o.apache.sling.audit.osgi.installer - Deleted configuration 
> c.r.o.c.services.models.components.ImageComponentServiceImpl from resource 
> TaskResource(url=jcrinstall:/apps/sling/install/c.r.o.c.services.models.components.
>     ImageComponentServiceImpl.config, 
> entity=config:c.r.o.c.services.models.components.ImageComponentServiceImpl, 
> state=UNINSTALL, 
> attributes=[service.pid=c.r.o.c.services.models.components.ImageComponentServiceImpl,
>  resource.uri    
> .hint=c.r.o.c.services.models.components.ImageComponentServiceImpl], 
> digest=5474257d3971e3f9a92ac39b2f2d4b69)
> INFO  c.r.o.c - Service 
> [c.r.o.c.services.models.components.ImageComponentServiceImpl,1451] 
> ServiceEvent UNREGISTERING
> INFO  c.r.o.c - Service 
> [c.r.o.c.services.models.components.ImageComponentServiceImpl,1452] 
> ServiceEvent REGISTERED
>
> Is that an expected behaviour? How do you handle your configuration? I looked 
> at many documentation but didn't find any resource that could explain this 
> problem. Any help would be appreciated :)
>
> Thank you,
>
> Guillaume
>
>

Reply via email to