Custom servlet is not hitting in AEM as cloud service publisher instance | Community
Skip to main content
chetan001
Level 3
Mar 3, 2022 10:31 AM UTC
Solved

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

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.
chetan001
chetan001Accepted solution
Level 3
Mar 9, 2022 5:14 PM UTC

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

 

Thanks All for your inputs

8 replies

chetan001
chetan001AuthorAccepted solution
Level 3
Mar 9, 2022 5:14 PM UTC

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

 

Thanks All for your inputs

Translate
joerghoh
Employee
Mar 4, 2022 9:53 AM UTC

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.

Translate
chetan001
chetan001Author
Level 3
Mar 4, 2022 12:58 PM UTC

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

Translate
joerghoh
Employee
Mar 6, 2022 10:05 AM UTC

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?

Translate
Pallavi_Shukla_
New Participant
Mar 3, 2022 12:07 PM UTC

Are you able to whitelist your servlet path in publishers.

Translate
chetan001
chetan001Author
Level 3
Mar 3, 2022 2:00 PM UTC

Yes, even it is hitting from postman

Translate
Pallavi_Shukla_
New Participant
Mar 3, 2022 2:04 PM UTC

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

Translate