404 error in a higher environment when accessing servlet path

binoyp

07-09-2020

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 ?

Accepted Solutions (1)

Accepted Solutions (1)

Andrei_Dantsou

07-09-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-co... for more details.

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



Regards

Answers (3)

Answers (3)

Nikhil-Kumar

MVP

08-09-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 

surabhikatiyar

Employee

07-09-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-co... 

vanegi

Employee

07-09-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.