Custom servlet is not hitting in AEM as cloud service publisher instance | Community
Skip to main content
chetan001
Level 3
March 3, 2022
Solved

Custom servlet is not hitting in AEM as cloud service publisher instance

  • March 3, 2022
  • 3 replies
  • 4200 views

Hi All,

 

I am facing  problem in AEM as cloud service.

I am having one servlet which is triggering fine from cloud Author server.

 

but same is not hitting on publisher server. Request is coming to dispatcher  but not going to publisher server when request is initiated from my site page(from browser)

 

But when I direct hit the servlet from postman “publisher-name/bin/myServlet”  I see servlet is passing through dispatcher and then request is going to publisher instance.

 

Am I missing any configuration in AEM as cloud service publisher instance ?

 

FYI: Request is post

 

Thanks

Chetan

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 chetan001

This issue has been resolved by removing "origin" header from dispatcher header list.

 

Thanks All for your inputs

3 replies

Pallavi_Shukla_
Community Advisor
Community Advisor
March 3, 2022

Are you able to whitelist your servlet path in publishers.

chetan001
chetan001Author
Level 3
March 3, 2022

Yes, even it is hitting from postman

Pallavi_Shukla_
Community Advisor
Community Advisor
March 3, 2022

Can you provide request/access logs - are you getting any 403 ? Moreover is there anything you might need to whitelist in the Referrer filer settings?

 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-configure-apache-sling-referrer-filter-to-mitigate-the/m-p/299707

joerghoh
Adobe Employee
Adobe Employee
March 4, 2022

Most likely the problem is that the path "/bin" is blocked on dispatcher (or even by default on AEM as a Cloud Service publish, not sure).

I would recommend you to bind servlets to resource types as much as possible. Binding to a path is not best practice.

 

Next: /bin is used by some other servlets (most notably the infamous /bin/wcmcommand), and therefor blocking it completely makes totally sense. Meaning when you want to unblock your servlet, just unblock that specific path.

chetan001
chetan001Author
Level 3
March 4, 2022

Thanks @joerghoh  for your input.

 

I see in dispatcher logs nothing is blocking .request is passing from dispatcher but not reaching to publisher instance.

 

getting this response status in dispatcher logs.

response.status =204 

 

 

Thanks

Chetan

joerghoh
Adobe Employee
Adobe Employee
March 6, 2022

If it passes the dispatcher, then it should reach AEM. Unless you use mod_proxy and forward it to a different system.

 

The statuscode 204 also looks a bit strange. Is this a POST request? What parameters are you sending along?

chetan001
chetan001AuthorAccepted solution
Level 3
March 9, 2022

This issue has been resolved by removing "origin" header from dispatcher header list.

 

Thanks All for your inputs