404 error in a higher environment when accessing servlet path | Community
Skip to main content
September 7, 2020
Solved

404 error in a higher environment when accessing servlet path

  • September 7, 2020
  • 4 replies
  • 1560 views

Hi All,

 

I have a custom servlet that uses querybuilder api that works fine on lower environment / develop . 

Its registered by path as follows /bin/.... .

However on the higher environments this throws a 404 error.

Is this caused due to restrictions at dispatcher end ?

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

Hello @binoyp,

First of all, you should ensure that the servlet is available on Publish of the desired environment. If the servlet is available on Publish, then you should check Dispatcher config containing "filter" section to ensure that the servlet path is allowed there, please see https://docs.adobe.com/content/help/en/experience-manager-dispatcher/using/configuring/dispatcher-configuration.html#defining-a-filter for more details.

/filter {
    /xxxx { /type "allow" /url "/servlet/path" }
}



Regards

4 replies

Andrei_Dantsou
Andrei_DantsouAccepted solution
September 7, 2020

Hello @binoyp,

First of all, you should ensure that the servlet is available on Publish of the desired environment. If the servlet is available on Publish, then you should check Dispatcher config containing "filter" section to ensure that the servlet path is allowed there, please see https://docs.adobe.com/content/help/en/experience-manager-dispatcher/using/configuring/dispatcher-configuration.html#defining-a-filter for more details.

/filter {
    /xxxx { /type "allow" /url "/servlet/path" }
}



Regards

vanegi
Adobe Employee
Adobe Employee
September 7, 2020

Indeed, you can check at dispatcher if the servlet is allowed, by checking under the /filter rules in dispatcher.any. Also, do check if your servlet is active and having the required entries in pom.xml, ensure that you can see this servlet in osgi.

 

 

Surabhi_Katiyar
Adobe Employee
Adobe Employee
September 7, 2020

For this do check the dispatcher.any file. in this file you will have a /filter header section that will specify which paths are allowed and which paths are denied. In this file do check the below rule is added in order to access a servlet with /bin 

 

/0022 { /type "allow" /url "/bin/*"    }

For the complete filter section please check the document with details about the above rules and the other filter section rules.

 

https://docs.adobe.com/content/help/en/experience-manager-dispatcher/using/configuring/dispatcher-configuration.html#example-filter-section 

Nikhil-Kumar
Community Advisor
Community Advisor
September 8, 2020

@binoyp 

Check for servlet on publish instance. If it's present in publish then verify the dispatcher filter weather this servlet is registered or not.

{ /type "allow" /url "/bin/...."    }



Thanks,
Niikhil