Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

AEM OOTB Sitemap Scheduler is not generating Sitemaps

Avatar

Level 3

Hello,

We’re upgrading AEM Service Pack to use Sitemap feature and trying to setup a scheduler for Sitemap Generation (org.apache.sling.sitemap.impl.SitemapScheduler) but It’s not able to execute and in error.log, getting this:

radhag85825056_0-1682508408866.png

 

 

org.apache.jackrabbit.oak.plugins.index.Cursors$TraversingCursor Traversed 3000 nodes with filter Filter(query=select [jcr:path], [jcr:score], * from [nt:base] as a where [sling:sitemapRoot] = true and isdescendantnode(a, '/content/we-retail/us') option(index tag [slingSitemaps]) /* xpath: /jcr:root/content/we-retail/us//*[@sling:sitemapRoot=true] option(index tag slingSitemaps) */, path=/content/we-retail/us//*, property=[:indexTag=[slingSitemaps], sling:sitemapRoot=[true]]); consider creating an index or changing the query

Since this query get's generated based on what we enter in scheduler So, not sure if we can change the query here somehow?

So, I tried indexing but still it doesn't seem to work.

radhag85825056_1-1682508408868.png

 

 


Can anyone suggests what I'm missing here?


Regards,

Radha

1 Accepted Solution

Avatar

Correct answer by
Level 3

Thankyou @Dipti_Chauhan . 

Issue is fixed now. I've created a index for sling:sitemapRoot property and created a config /apps/weretail/config.publish/org.apache.sling.sitemap.impl.SitemapScheduler~weretail.cfg.json inside config.publish folder. 

Earlier I was creating this config directly from /system/console/configMgr and seems like it was not picking up the correct config, if create it from configMgr.

Regards,

Radha

View solution in original post

8 Replies

Avatar

Community Advisor

Hello @aemuser2021  - 

 

I would suggest you to go through this blog https://aemsimplifiedbynikhil.wordpress.com/2021/12/01/apache-sling-sitemap-for-aem-6-5-11-and-aemaa... 

 

This should be solving the problem. But let me know if does not solve your problem.

Avatar

Level 3

Hi @Tanika02 ,

Thankyou for sharing this. I've followed this article only for setting up the scheduler but it's not able to solve my issue. 

I've tried adding this new property too on the node: /oak:index/siteMap but after this scheduler is not even getting initiated.

 

radhag85825056_0-1682519017729.png

 

Avatar

Community Advisor

@aemuser2021  - Could you please share the error.log to understand the issue better?

Avatar

Level 3

Hi @Tanika02 ,

Here's the error.log -

 

26.04.2023 23:06:00.002 *WARN* [sling-default-5-My Sitemap Scheduler] org.apache.jackrabbit.oak.query.QueryImpl Traversal query (query without index): select [jcr:path], [jcr:score], * from [nt:base] as a where [sling:sitemapRoot] = true and isdescendantnode(a, '/content/we-retail/us') option(index tag [slingSitemaps]) /* xpath: /jcr:root/content/we-retail/us//*[@sling:sitemapRoot=true] option(index tag slingSitemaps) */; consider creating an index

26.04.2023 23:06:00.012 *WARN* [sling-default-5-My Sitemap Scheduler] org.apache.jackrabbit.oak.plugins.index.Cursors$TraversingCursor Traversed 1000 nodes with filter Filter(query=select [jcr:path], [jcr:score], * from [nt:base] as a where [sling:sitemapRoot] = true and isdescendantnode(a, '/content/we-retail/us') option(index tag [slingSitemaps]) /* xpath: /jcr:root/content/we-retail/us//*[@sling:sitemapRoot=true] option(index tag slingSitemaps) */, path=/content/we-retail/us//*, property=[:indexTag=[slingSitemaps], sling:sitemapRoot=[true]]); consider creating an index or changing the query

26.04.2023 23:06:00.022 *WARN* [sling-default-5-My Sitemap Scheduler] org.apache.jackrabbit.oak.plugins.index.Cursors$TraversingCursor Traversed 2000 nodes with filter Filter(query=select [jcr:path], [jcr:score], * from [nt:base] as a where [sling:sitemapRoot] = true and isdescendantnode(a, '/content/we-retail/us') option(index tag [slingSitemaps]) /* xpath: /jcr:root/content/we-retail/us//*[@sling:sitemapRoot=true] option(index tag slingSitemaps) */, path=/content/we-retail/us//*, property=[:indexTag=[slingSitemaps], sling:sitemapRoot=[true]]); consider creating an index or changing the query

26.04.2023 23:06:00.032 *WARN* [sling-default-5-My Sitemap Scheduler] org.apache.jackrabbit.oak.plugins.index.Cursors$TraversingCursor Traversed 3000 nodes with filter Filter(query=select [jcr:path], [jcr:score], * from [nt:base] as a where [sling:sitemapRoot] = true and isdescendantnode(a, '/content/we-retail/us') option(index tag [slingSitemaps]) /* xpath: /jcr:root/content/we-retail/us//*[@sling:sitemapRoot=true] option(index tag slingSitemaps) */, path=/content/we-retail/us//*, property=[:indexTag=[slingSitemaps], sling:sitemapRoot=[true]]); consider creating an index or changing the query

26.04.2023 23:06:00.041 *WARN* [sling-default-5-My Sitemap Scheduler] org.apache.jackrabbit.oak.plugins.index.Cursors$TraversingCursor Traversed 4000 nodes with filter Filter(query=select [jcr:path], [jcr:score], * from [nt:base] as a where [sling:sitemapRoot] = true and isdescendantnode(a, '/content/we-retail/us') option(index tag [slingSitemaps]) /* xpath: /jcr:root/content/we-retail/us//*[@sling:sitemapRoot=true] option(index tag slingSitemaps) */, path=/content/we-retail/us//*, property=[:indexTag=[slingSitemaps], sling:sitemapRoot=[true]]); consider creating an index or changing the query

 



 

Avatar

Correct answer by
Level 3

Thankyou @Dipti_Chauhan . 

Issue is fixed now. I've created a index for sling:sitemapRoot property and created a config /apps/weretail/config.publish/org.apache.sling.sitemap.impl.SitemapScheduler~weretail.cfg.json inside config.publish folder. 

Earlier I was creating this config directly from /system/console/configMgr and seems like it was not picking up the correct config, if create it from configMgr.

Regards,

Radha

Avatar

Employee Advisor

Could you please let me know your index for sling:sitemapRoot property.

 

I have tried with following oak:index -

<siteMap
        jcr:primaryType="oak:QueryIndexDefinition"
        async="[async]"
        compatVersion="{Long}2"
        evaluatePathRestrictions="{Boolean}true"
        includedPaths="[/content/we-retail/us]"
        reindex="{Boolean}false"
        reindexCount="{Long}5"
        seed="{Long}3408412449185876957"
        type="lucene">
        <indexRules jcr:primaryType="nt:unstructured">
            <nt:base
                jcr:primaryType="nt:unstructured"
                includePropertyTypes="all">
                <properties jcr:primaryType="nt:unstructured">
                    <sitemapRoot
                        jcr:primaryType="nt:unstructured"
                        name="sling:sitemapRoot"
                        propertyIndex="{Boolean}true"
                        type="Boolean"/>
                </properties>
            </nt:base>
        </indexRules>
    </siteMap>

 and it was unable to generate sitemap.