Expand my Community achievements bar.

AEM servlet throwing HTTP Error 404.0 - Not found on Dispatcher IIS 10

Avatar

Level 2

Hi Community,

 

I am seeing an issue where AEM custom sling servlet is not accessible on one of the Dispatcher servers (IIS 10).

 

On trying to access the servlet, I get this error:

 

SmrithiG1_0-1741786527590.png

 

I have added filter to allow the servlet path in dispatcher.any file.

/0116 { /type "allow" /method "GET" /url "/bin/nameofthepath*" }

 

The pages are loading fine, just the servlets are not working. Kindly let me know if I am missing out anything. Appreciate your support.

 

Please note: The custom sling servlet is working fine on publish instance.

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

15 Replies

Avatar

Level 2

I have also provided all permissions for DefaultAppPool 

 

SmrithiG1_0-1741786864623.png

 

Avatar

Employee

@SmrithiG1 Have you checked dispatcher log?  Is your servlet path resolving to required farm file which contains the /allow filter you mentioned above?

Avatar

Level 2

Hi @PavanGaddam ,

 

Yes I checked the dispatcher.log and the servlet path not shown in the logs at all.

 

I can see logs like request declined on trying to access the servlet.

 

But on the working Dispatcher server (another instance), I can see the request and the servlet path is resolving to required farm file.

 

Avatar

Employee

Try comparing the configuration files between the server where it is working and where it is not. Look at all the /deny rules in the /filter section.

Avatar

Community Advisor

Hi @SmrithiG1 ,

 

It looks like the issue may be related to the Dispatcher configuration. Here’s an additional step to check:

  1. Ensure there are no conflicting rewrite rules in the dispatcher files that might be preventing access to the /bin/ URL path.
  2. Review the Dispatcher logs for any errors or clues as to why the servlet request might be getting blocked or not routed properly.

Also, could you confirm if other path based servlets are working fine on the same Dispatcher server? Just to make sure its not related to some typo in configuration.

 

Let me know if this helps!

 

Thanks

Ritesh Mittal

Avatar

Level 2

Hi @Ritesh_Mittal 

 

1. I have cross checked the filter rules in dispatcher.any file. I have added 5 filter rules for five different custom servlet, all registered under /bin path. The difficulty that I am finding is that, the same dispatcher.any file is used on all other envs and multiple servers and they all seem to work fine.

2. I can see only debug and trace logs and there is no error log recorded.

3. All the other custom sling servlets are also not accessible and is throwing the same error.

 

Do you think this can be the issue with IIS installation on this server.

Can I try a reinstallation of IIS.

 

 

 

Avatar

Community Advisor

Try below-

  1. Check if the Dispatcher module is properly installed on IIS.
  2. Look for any issues with request forwarding or access to /bin/ paths in the IIS logs.
  3. Try restarting IIS and clearing the dispatcher cache.
  4. Reinstall IIS : Only consider if the above steps don’t resolve the issue.

Avatar

Level 2

can you please let me know how to look for issues with request to access /bin path in IIS logs.

I have set up IIS logs.

These are the logs thats coming up there:

 

10.194.193.56, -, 3/13/2025, 9:12:17, W3SVC1, <Servername>, <ipaddress of the server>, 0, 768, 5009, 404, 2, GET, /bin/nameofthepath, tag=<nameofthetag>,

Avatar

Level 2

Hi @Ritesh_Mittal 

 

I tried reinstalling IIS on windows and I still see the same error.

 

Steps followed.

1. Uninstalled IIS

2. Installed IIS 

3. Added the script folder with all the config files and dispatcher.any file

4. configured handler mappings

5. the home page is loading fine like before and url rewrites are working but sling servlets are not for some reason.

 

SmrithiG1_0-1741874340887.png

 

Avatar

Community Advisor

If other requests are going through the dispatcher then I think your iis configuration are correct. Try changing the dispatcher log level to trace and check what’s happening on the particular servlet request. Trace log level will trace everything for that request and will also logs what causing this request call to be blocked/denied 

Hope this helps

Avatar

Level 2

I tried my updating the log level to trace.

I believe the request is blocked, as I dont see any log info related to the servlet request.

 

All other pages are loading fine on dispatcher and URL rewrite rules are working too on the pages.

Just the sling servlets are not working.

 

Tried restarting IIS and cleared dispatcher cache too.

 

 

Avatar

Community Advisor

With the log level as trace on dispatcher you can still see the entry for your request if it’s coming to dispatcher even if dispatcher filter rules block it. This lead me to conclude that you need to debug on IIS server. I believe somehow this server is blocking the request. Do you se the option to change the log level to trace or debug for your IIS server?

Avatar

Level 2

Yes, I have updated the log level to trace, but i dont see the request reaching the logs.

 

I think so the request is not reaching dispatcher due to permission issue or some missing file like the error displayed on the screen.

 

I have cross checked the permissions, and DefaultAppPool has all the permissions for initpub/wwwroot folder.

Avatar

Community Advisor

Hi @SmrithiG1 ,

You may check https://forums.ivanti.com/s/article/Issue-IIS-blocks-access-to-bin-folders-and-specific-extension-ty...

Or

Can you rewrite the path to /api/pathname instead of /bin just for testing purpose by allowing in Apache Sling Servlet/Script Resolver and Error Handler

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/why-do-sling-servlets-only...

Thanks

Avatar

Level 2

HI @MukeshYadav_ , I did try the first option that you provided.

 

Its the same error still.

 

The second one I didnt try, as I already have another servlet which is not using /bin and it is also not working.