Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

404 error in a higher environment when accessing servlet path

Avatar

Level 2

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 ?

1 Accepted Solution

Avatar

Correct answer by
Level 4

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

View solution in original post

4 Replies

Avatar

Correct answer by
Level 4

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

Avatar

Employee

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.

 

 

Avatar

Employee Advisor

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

Avatar

Community Advisor

@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