Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

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

Avatar

Level 4

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

1 Accepted Solution

Avatar

Correct answer by
Level 4

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

 

Thanks All for your inputs

View solution in original post

8 Replies

Avatar

Community Advisor

Are you able to whitelist your servlet path in publishers.config.png

Avatar

Community Advisor

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

Avatar

Level 4

hi @Pallavi_Shukla_  

 

Thanks for your input. yes these settings are there.  working with adobe team if any specific setting need to put.

 

Thanks

Chetan

Avatar

Employee Advisor

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.

Avatar

Level 4

Thanks @Jörg_Hoh  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

Avatar

Employee Advisor

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?

Avatar

Correct answer by
Level 4

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

 

Thanks All for your inputs