Expand my Community achievements bar.

Issue getting properties values when using URL shortening with /etc/map

Avatar

Level 4

Hi, I am facing an issue and I suspect it is because of the URL shortening using /etc/map (AEM 6.1). Mapping is being applied only to publish instances. This is the issue: content is edited as usual in the author instance, but in publish reading the properties from the data entered into the components fails. That is, even a simple title component fails. If I disable the mapping, publish renders the page as expected, but not sure how the mapping is affecting. Network panel shows that all requests return 200, CSS and JS return 304. The same thing happens if I try to use a controller class that extends WCMUsePojo, since calling getProperties() return two different results depending if I use the mapping or not. With the mapping disabled, I get the properties, but I enable it, getProperties().get("myProp", clazz.class) returns null.

The only clue I have is if I call getResource with the /etc/map enabled, I get a SyntheticResource which is a bad sign. But other than that, I do not have more hints of the real issue, that is, what could be affected by the mapping that in the end affects how to read data from properties. Any ideas? Really appreciated

5 Replies

Avatar

Level 4

Mapping applies based on the mapping.location property in the resource resolver.  It is for URL resolution; should not create issues in normal components. There must be error in the logs. Please check the error logs for errors.

Avatar

Employee

Should be of any problem, perhaps you are hitting another issue.

Can you try to do ${properties.myprop} in your component, to see if that makes a difference.

Avatar

Level 4

Sure, enabling Sling Resolver logs to Debug, I get entries like these:

Cannot resolve path '/apps/foundation/components/primary/sling/servlet/default' to a resource org.apache.sling.resourceresolver.impl.ResourceResolverImpl getResourceInternal: Cannot resolve path '/var/eventing/jobs/assigned/fc9569c2-bf74-428c-8f5d-b8ee0b0a6152/com.adobe.cq.collection.update.job/2016/9/30/13/36' to a resource org.apache.sling.resourceresolver.impl.ResourceResolverImpl getResourceInternal: Cannot resolve path '/libs/dam/Asset' to a resource org.apache.sling.resourceresolver.impl.ResourceResolverImpl getResourceInternal: Cannot resolve path '/var/classes/fc9569c2-bf74-428c-8f5d-b8ee0b0a6152/sightly/1.0.2/libs/wcm/foundation/components/parsys/SightlyJava_parsys.java/jcr:content' to a resource GET /base/es/some.html HTTP/1.1] org.apache.sling.resourceresolver.impl.ResourceResolverImpl getResourceInternal: Cannot resolve path '/libs/wcm/foundation/components/parsys/parsys.html/parsys.js' to a resource

Clearly, I think entries should be added to the etc/map but I do not know how the values should be.

Avatar

Level 4

Same result. But it was thanks to Java controllers that I was able to get a little more info.

Avatar

Employee

Did you by any chance downgraded your JVM or so.

Messages like Cannot resolve path '/libs/wcm/foundation/components/parsys/parsys.html/parsys.js' to a resource indicates that your instance is not very healthy I would say..