[
https://issues.apache.org/jira/browse/SLING-11773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17688346#comment-17688346
]
Radu Cotescu commented on SLING-11773:
--------------------------------------
There's an additional issue though. With the migration, the components are
registered only based on the configuration properties. The registration
properties are ignored. See SLING-11774. I already have a fix that I'm testing,
haven't committed it yet.
> ResourceTypeHierarchyBasedResourcePicker not working anymore
> ------------------------------------------------------------
>
> Key: SLING-11773
> URL: https://issues.apache.org/jira/browse/SLING-11773
> Project: Sling
> Issue Type: Bug
> Components: Extensions
> Affects Versions: Resource Merger 1.4.0
> Reporter: Sagar Miglani
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> In SLING-10168, SCR annotations were replaced by OSGi and configurations of
> {{ResourceTypeHierarchyBasedResourcePicker}} have been designated to an inner
> Configuration class, which are not getting bind properly without
> {{@Activate}} Method.
> And hence {{ResourceTypeHierarchyBasedResourcePicker}} does not seem to be
> registered by
> {{MergedResourcePickerWhiteboard}} [0].
> Compared generated XMLs:
> *With {{Activate}} Method injection:*
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.3.0"
> name="org.apache.sling.resourcemerger.picker.overriding"
> configuration-policy="require" activate="activate">
> <property name="merge.root" type="String" value="/mnt/override"/>
> <property name="merge.readOnly" type="Boolean" value="true"/>
> <property name="merge.traverseParent" type="Boolean" value="true"/>
> <service>
> <provide
> interface="org.apache.sling.resourcemerger.spi.MergedResourcePicker2"/>
> </service>
> <implementation
> class="org.apache.sling.resourcemerger.impl.picker.ResourceTypeHierarchyBasedResourcePicker"/>
> </scr:component>
> {code}
> *Without {{@Activate}} method injection:*
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.3.0"
> name="org.apache.sling.resourcemerger.picker.overriding"
> configuration-policy="require">
> <property name="merge.traverseParent" type="Boolean" value="true"/>
> <service>
> <provide
> interface="org.apache.sling.resourcemerger.spi.MergedResourcePicker2"/>
> </service>
> <implementation
> class="org.apache.sling.resourcemerger.impl.picker.ResourceTypeHierarchyBasedResourcePicker"/>
> </scr:component>
> {code}
> [0]:
> https://github.com/apache/sling-org-apache-sling-resourcemerger/blob/master/src/main/java/org/apache/sling/resourcemerger/impl/MergedResourcePickerWhiteboard.java#L87
--
This message was sent by Atlassian Jira
(v8.20.10#820010)