You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Santiago García Pimentel (JIRA)" <ji...@apache.org> on 2016/11/29 16:48:58 UTC
[jira] [Created] (SLING-6341) ResourcePath injector does not
correctly wraps to array
Santiago García Pimentel created SLING-6341:
-----------------------------------------------
Summary: ResourcePath injector does not correctly wraps to array
Key: SLING-6341
URL: https://issues.apache.org/jira/browse/SLING-6341
Project: Sling
Issue Type: Bug
Affects Versions: Sling Models Impl 1.2.2
Reporter: Santiago García Pimentel
In a sling model, when injecting resources from the resourcePath injector, if you declare the injected field as an array, the injection will fail.
Injection works fine if you declare the field as a list.
to verify.
Have a resource which holds a property with a path to other resource.
Have the following injection:
@ResourcePath(path = "/content/test/node")
private Resource[] pathProperty;
I get the following:
org.apache.sling.models.factory.ModelClassException: Could not adapt from class org.apache.sling.jcr.resource.internal.helper.jcr.JcrNodeResource to class [Lorg.apache.sling.api.resource.Resource;
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)