You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Justin Edelson (JIRA)" <ji...@apache.org> on 2016/11/30 17:47:59 UTC

[jira] [Assigned] (SLING-6341) ResourcePath injector does not correctly wraps to array

     [ https://issues.apache.org/jira/browse/SLING-6341?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Edelson reassigned SLING-6341:
-------------------------------------

    Assignee: Justin Edelson

> 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
>            Assignee: Justin Edelson
>             Fix For: Sling Models Impl 1.3.6
>
>
> 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)