I have two OSGi bundles that I deploy in Sling/Felix.
Bundle Core is Java code (OSGi Services and Sling models), Bundle UI contains only JSPs and JS code, imported in the repository using Sling-initial-content.
Bundle A is deployed first, registers services, for instance, put the root URL to get images for the application:
[c.r.o.c.services.models.components.ImageComponentServiceImpl,1410] ServiceEvent REGISTERED
Here is the associated class with the property:
@Component(metatype=true, label="Image component service", description="Service providing data to image components")
@Service(value = ImageComponentService.class)
public class ImageComponentServiceImpl extends AbstractModelService implements ImageComponentService {
@Property(label="Images root URL", description="URL to the web directory containing image files")
public static final String IMAGE_ROOT_URL = "image.root.url";
}
Then I add a value to the property on this service:
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
But when I deployed the Bundle UI I get this:
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
Why is it removing the configuration from the other bundle? Those bundles work together but are not related by Import/Export-Instructions.
I have updated org.apache.sling.installer.provider.jcr to 3.1.18 but it's the same.
Could it be related to https://issues.apache.org/jira/browse/SLING-4925 / https://issues.apache.org/jira/browse/SLING-4929 ? It requires to update Jackrabbit and I'm not sure it's easy with existing content.