Skip to main content
donquixote_dofl
Level 2
Jun 9, 2025 9:37 AM UTC
Question

How to debug Sling JSON Exporter issues?

Encountered a weird behaviour in one of the environment.
I have a page /content/sites/na/us/en/samplepage when I have browsed this /content/sites/na/us/en/samplepage.infinity.json  in one of the environment I am able to get JSON results where as in other environment I am getting plain html. Suprisingly both environment have the same code package deployed but having the differences in serving the content.

*there is no dispatcher involved in both environments, So where do I start to figure out the root cause !!!

Thanks in advance... 🙂

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

SantoshSai
Community Advisor
Community Advisor
Jun 9, 2025 6:05 PM UTC

Hi @donquixote_dofl,

1. Check Request Accept Header
  • The .infinity.json suffix should return JSON regardless, but if there’s a difference in the Accept HTTP header (e.g., one environment treats it differently), it could affect Sling’s response type negotiation.

  • Use a tool like Postman or curl to compare request headers exactly between environments.

curl -I https://yourserver/content/sites/na/us/en/samplepage.infinity.json
2. Verify Sling Resource Resolution and Selectors
  • Confirm the .infinity.json selector is correctly recognized.

  • Make sure both environments have the same Sling Resource Types and Servlet Mappings.

  • If the resource type or script rendering JSON is missing or overridden in one environment, it might fallback to HTML.

Translate
Santosh Sai
donquixote_dofl
Level 2
Jun 11, 2025 6:17 AM UTC

In both environments have the same Sling Resource Types and Servlet Mappings, and the selectors also correctly recognized.

Translate
SureshDhulipudi
Community Advisor
Community Advisor
Jun 9, 2025 8:18 PM UTC

Did you check error logs? in both environments?

 

Review the AEM error logs (error.log) in both environments for any exceptions or warnings when accessing .infinity.json.
Look for issues related to Sling Models, resource resolution, or servlet handling.

 

Check Sling Mappings and Resource Resolution
Verify if there are any differences in the Sling Resource Resolver configurations between the two environments.
Go to /system/console/configMgr and check the Apache Sling Resource Resolver Factory configuration.
Ensure that the JSON extension is not being overridden or mapped differently in one environment.

Translate
donquixote_dofl
Level 2
Jun 11, 2025 6:16 AM UTC

Sling Resource Resolver configurations between the two environments are same no difference. 

Translate