Error on hitting Custom Servlet | Community
Skip to main content
July 25, 2022
Solved

Error on hitting Custom Servlet

  • July 25, 2022
  • 2 replies
  • 1397 views

Hi all,

 

I have created a service to upload a file on google drive and created a servlet to call the service. When I hit the url defined in servlet I get "A custom errorhandler for 404 responses"

 

I have used Java-Okhttp to get the accestoken in the sevice.

So, please can anyone help me to resolve the problem

 

 

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 AshwiniSathe1

Check if your servlet is in active state by visiting http://localhost:4502/system/console/components. Check what are all the paths allowed in OSGi configuration Apache Sling Servlet / Script Resolver and Error Handler. Also try to register servlet with some other path and verify if it is working.

2 replies

SantoshSai
Community Advisor
Community Advisor
July 25, 2022

Hi @janhavi_singh ,

Please test whether your servlet request here is responsible to handle that request by visiting http://localhost:4502/system/console/servletresolver 


Might be multifarious reasons,
Check your servlet is in active status, is your dispatcher blocking request - check it hitting on publisher.

Hope that helps!

Regards,

Santosh
 

Santosh Sai
AshwiniSathe1
July 25, 2022

Hi @janhavi_singh : Check if servlet is in active state also check if the servlet path getting resolved. Check error logs for more details on what is the cause of the issue. Please provide more details so we can help you to resolve the problem.

July 26, 2022

In the error logs I get /bin/servlets/myservlet not found.

AshwiniSathe1
AshwiniSathe1Accepted solution
July 26, 2022

Check if your servlet is in active state by visiting http://localhost:4502/system/console/components. Check what are all the paths allowed in OSGi configuration Apache Sling Servlet / Script Resolver and Error Handler. Also try to register servlet with some other path and verify if it is working.