Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Path-Based Servlet Not Resolving Correctly for One Extension in Specific AEM Environment

Avatar

Level 1

Hi Community,

 

I'm working on an AEM project where I’ve implemented a path-based servlet that handles four different extensions (e.g., .json, .xml, .txt, .custom). The servlet is registered using @SlingServletResourceTypes with specific extensions.

 

The issue I'm facing is that one of the extensions is not resolving correctly only in one specific environment (e.g., staging). For the problematic extension (say .custom), the URL resolution fails — the extension gets appended to the path instead of being resolved properly, and it ends up getting routed to some default Apache servlet instead of my custom path-based servlet.

 

Here are some additional details:

 

The same code and configuration work perfectly fine in all other environments, including local and dev.

 

The other three extensions are working as expected in all environments.

 

The servlet path and resourceType are properly configured and unchanged across environments.

 

No custom Apache rewrite or dispatcher rules seem to be affecting this.

 

 

Has anyone faced a similar issue or can help me debug what might be going wrong with this specific extension resolution in that environment?

 

Any insights would be highly appreciated.

 

Thanks,

Gnaneswar

1 Reply

Avatar

Adobe Champion

Do you have any way to debug and observe the request pipeline, e.g. via dispatcher logs? That is usually a first stop.

 

Is there a chance the servlet OSGi config is missing for stage and the servlet has a config policy set to "required"?

 

These are my first thoughts just based on what you mention above.

 

Related links

https://docs.osgi.org/javadoc/r5/enterprise/org/osgi/service/component/annotations/ConfigurationPoli...

 

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/dep...