[ 
https://issues.apache.org/jira/browse/SLING-13248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18099118#comment-18099118
 ] 

Joerg Hoh commented on SLING-13248:
-----------------------------------

[~reschke] On a SLING side the information about property types is not directly 
available through its official API. Even while the implementation allows to 
read the property type like this, we probably should not use this approach to 
discard all non-STRING types.

{noformat}
Property p = valuemap.get("sling:alias", Property.class); // implementation 
detail of the JCR Resource Bundle
if (p.getType() == PropertyType.STRING) {
  ...
}
{noformat}


For that reason we need to restrict the query to String properties only (using 
the approach shown in the Oak PR), but unfortunately this does not have an 
influence on the result as of today due to this issue in Oak.

For that reason I suggest to 
 # change the JCR query on the Sling side to restrict the search to properties 
of the type String
 # and fix the behavior on the Oak side.

both can happen in parallel, as with just 1 OR 2 being implemented the 
behaviour will be the same as today, and only if both are implemented the 
situation is handled correctly.

 

> Exception while initializing Vanity paths
> -----------------------------------------
>
>                 Key: SLING-13248
>                 URL: https://issues.apache.org/jira/browse/SLING-13248
>             Project: Sling
>          Issue Type: Task
>          Components: ResourceResolver
>    Affects Versions: Resource Resolver 1.12.12
>            Reporter: Joerg Hoh
>            Assignee: Joerg Hoh
>            Priority: Major
>
> Came across the case, that the Sling vanity path resolution was not using the 
> cache, but it was resolving the vanity paths always within the 
> {{ResourceResolver.resolve(path)}} codepath.
> It seems to be caused by this exception:
> {noformat}
> 18.06.2026 10:12:45.421 *ERROR* [VanityPathInitializer] 
> org.apache.sling.resourceresolver.impl.mapping.PagedQueryIterator unexpected 
> query result in page 0, property name 'sling:vanityPath', got '/acs-commons', 
> last value was '2025-10-14T20:32:01.481Z'
> 18.06.2026 10:12:45.422 *ERROR* [VanityPathInitializer] 
> org.apache.sling.resourceresolver.impl.mapping.VanityPathHandler vanity path 
> initializer thread terminated with an exception
> org.apache.sling.resourceresolver.impl.mapping.PagedQueryIterator$QueryImplementationException:
>  unexpected query result in page 0, property name 'sling:vanityPath', got 
> '/acs-commons', last value was '2025-10-14T20:32:01.481Z'
>         at 
> org.apache.sling.resourceresolver.impl.mapping.PagedQueryIterator.getNext(PagedQueryIterator.java:104)
>  [org.apache.sling.resourceresolver:1.12.12]
>         at 
> org.apache.sling.resourceresolver.impl.mapping.PagedQueryIterator.hasNext(PagedQueryIterator.java:135)
>  [org.apache.sling.resourceresolver:1.12.12]
>         at 
> org.apache.sling.resourceresolver.impl.mapping.VanityPathHandler.loadVanityPaths(VanityPathHandler.java:491)
>  [org.apache.sling.resourceresolver:1.12.12]
>         at 
> org.apache.sling.resourceresolver.impl.mapping.VanityPathHandler$VanityPathInitializer.execute(VanityPathHandler.java:199)
>  [org.apache.sling.resourceresolver:1.12.12]
>         at 
> org.apache.sling.resourceresolver.impl.mapping.VanityPathHandler$VanityPathInitializer.run(VanityPathHandler.java:186)
>  [org.apache.sling.resourceresolver:1.12.12]
>         at java.base/java.lang.Thread.run(Thread.java:1583)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to