From dev-return-104143-archive-asf-public=cust-asf.ponee.io@sling.apache.org Thu Feb 27 16:35:02 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 30EC1180181 for ; Thu, 27 Feb 2020 17:35:02 +0100 (CET) Received: (qmail 23037 invoked by uid 500); 27 Feb 2020 16:35:01 -0000 Mailing-List: contact dev-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list dev@sling.apache.org Received: (qmail 23006 invoked by uid 99); 27 Feb 2020 16:35:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Feb 2020 16:35:01 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 99499E12F2 for ; Thu, 27 Feb 2020 16:35:00 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 195937803F1 for ; Thu, 27 Feb 2020 16:35:00 +0000 (UTC) Date: Thu, 27 Feb 2020 16:35:00 +0000 (UTC) From: "Julian Sedding (Jira)" To: dev@sling.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (SLING-9076) CA config resolver API is not returning any resources when invoked on instance start MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SLING-9076?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1704= 6767#comment-17046767 ]=20 Julian Sedding edited comment on SLING-9076 at 2/27/20 4:34 PM: ---------------------------------------------------------------- [~nischgup] the scenario sounds basically like I had understood before. How= ever, it's not entirely correct. Let me explain: # your service depends on {{ConfigurationResourceResolver}}, which is impl= emented by {{ConfigurationResourceResolverImpl}} (I assume cardinality is M= ANDATORY) # {{ConfigurationResourceResolverImpl}} depends on {{ConfigurationResource= ResolvingStrategyMultiplexer}} with cardinality MANDATORY, which is impleme= nted by {{ConfigurationResourceResolvingStrategyMultiplexerImpl}} # {{ConfigurationResourceResolvingStrategyMultiplexerImpl}} depends on {{C= onfigurationResourceResolvingStrategy}} with cardinality MULTIPLE. Only the last point is problematic for you, so you can configure Configurat= ionResourceResolvingStrategyMultiplexerImpl to change the cardinality to AT= _LEAST_ONE (exactly as you request in this issue, just via configadmin). It may be confusing that I suggest configuring {{ConfigurationResourceResol= vingStrategyMultiplexerImpl}}, when it doesn't have a metatype (i.e. it doe= sn't show up in the web console). However, all DS components can be configu= red, regardless of whether they have a metatype or not. (I only reached thi= s insight after a few years.) Something like the following should work (-I didnt' test-). You can place t= he config file in the filesystem install folder or in the repository instal= l folder of your choice. On the first startup the configuration=C2=A0_may_ = be installed too late, but I expect everything to be fine on second startup= . {code:none|title=3Dorg.apache.sling.caconfig.resource.impl.ConfigurationRes= ourceResolvingStrategyMultiplexerImpl.config} configurationResourceResolvingStrategy.cardinality.minimum=3DI"1" configurationResourceResolvingStrategy.target=3D"(component.name\=3Dorg.apa= che.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingS= trategy)" {code} Note: the example assumes the latest caconfig-impl bundle is used. There we= re some changes to the implementation e.g. {{ So if you're running an older version, you may need to adjust the class nam= es. was (Author: jsedding): [~nischgup] the scenario sounds basically like I had understood before. How= ever, it's not entirely correct. Let me explain: # your service depends on {{ConfigurationResourceResolver}}, which is impl= emented by {{ConfigurationResourceResolverImpl}} (I assume cardinality is M= ANDATORY) # {{ConfigurationResourceResolverImpl}} depends on {{ConfigurationResource= ResolvingStrategyMultiplexer}} with cardinality MANDATORY, which is impleme= nted by {{ConfigurationResourceResolvingStrategyMultiplexerImpl}} # {{ConfigurationResourceResolvingStrategyMultiplexerImpl}} depends on {{C= onfigurationResourceResolvingStrategy}} with cardinality MULTIPLE. Only the last point is problematic for you, so you can configure Configurat= ionResourceResolvingStrategyMultiplexerImpl to change the cardinality to AT= _LEAST_ONE (exactly as you request in this issue, just via configadmin). It may be confusing that I suggest configuring {{ConfigurationResourceResol= vingStrategyMultiplexerImpl}}, when it doesn't have a metatype (i.e. it doe= sn't show up in the web console). However, all DS components can be configu= red, regardless of whether they have a metatype or not. (I only reached thi= s insight after a few years.) Something like the following should work (-I didnt' test-). You can place t= he config file in the filesystem install folder or in the repository instal= l folder of your choice. On the first startup the configuration=C2=A0_may_ = be installed too late, but I expect everything to be fine on second startup= . {code:none|title=3Dorg.apache.sling.caconfig.resource.impl.ConfigurationRes= ourceResolvingStrategyMultiplexerImpl.config} configurationResourceResolvingStrategy.cardinality.minimum=3DI"1" configurationResourceResolvingStrategy.target=3D"(component.name\=3Dorg.apa= che.sling.caconfig.resource.impl.def.DefaultConfigurationResourceResolvingS= trategy)" {code} > CA config resolver API is not returning any resources when invoked on ins= tance start > -------------------------------------------------------------------------= ----------- > > Key: SLING-9076 > URL: https://issues.apache.org/jira/browse/SLING-9076 > Project: Sling > Issue Type: Bug > Reporter: Nischay Gupta > Priority: Major > > Ca config resolver API is not returning any resources when invoked on bun= dle activate when AEM instance starts =E2=80=93 this is because of late bin= ding config resolution strategy service. > In=C2=A0*ConfigurationResourceResolvingStrategyMultiplexerImpl* the cardi= nality is set to atleast one=C2=A0*cardinality=3DReferenceCardinality.MULTI= PLE*=C2=A0but it should be=C2=A0=C2=A0*cardinality=3DReferenceCardinality.A= TLEAST_ONE* -- This message was sent by Atlassian Jira (v8.3.4#803005)