com.day.cq.wcm.core.impl.components.ComponentCacheImpl Requested Path xxxxx.servlet is not in available search paths

Avatar

Avatar

umamaheswariy65

Avatar

umamaheswariy65

umamaheswariy65

13-03-2018

Servlet everything looks good but not able to access the servlet after this warning it throwing the exception

org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught Throwable

javax.servlet.ServletException: Not a Sling HTTP request/response

Any ideas why this is happening.

Thanks In Advance.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

KiranVedantam1992

Avatar

KiranVedantam1992

KiranVedantam1992

25-10-2020

Just check the sling servlet method that you declared in component annotation and the method that is utilized in the class body. I declared METHOD_GET in component annotation and using doPost in the class by which I was getting the above error. Once it is corrected, the servlet started responding.

Answers (8)

Answers (8)

Avatar

Avatar

kranthiv7238223

Avatar

kranthiv7238223

kranthiv7238223

12-07-2019

me too facing same isue, any help is much appriciated. Thank you.

Avatar

Avatar

prabodhvk

Avatar

prabodhvk

prabodhvk

22-02-2019

Were you able to find a solution for this?

Avatar

Avatar

mind119497

Avatar

mind119497

mind119497

13-03-2018

That is my concern as well.

Why it is not allowing one and in another.

May be it is substituted but still can be able to access not only this one .. couple other servlets are there and using the same.

Need to figure it out what needs to be updated.

Thanks

Avatar

Avatar

Rima_Mittal

Avatar

Rima_Mittal

Rima_Mittal

13-03-2018

If you are using AEM 6.3, then felix annotations have to be substituted by OSGI annotations.

@SlingServlet is not allowed anymore, I am not sure how can you access the servlet from one of the bundles.

See SlingServlet Annotation here at the link Official OSGi Declarative Services Annotations in AEM - Adobe Experience Manager | AEM/CQ | Apache S...

Avatar

Avatar

mind119497

Avatar

mind119497

mind119497

13-03-2018

Hi ,

using AEM 6.3 and /services path configured in servlet resolved and OSGI component is Active. I am able to access the servlet from the bundle1 with the same code.  From bundle2 not able to access.

Thanks

Uma

Avatar

Avatar

Rima_Mittal

Avatar

Rima_Mittal

Rima_Mittal

13-03-2018

Hi,

1. Which version of AEM are you on?

2. Is /services/ added in execution paths(servletresolver.paths) in Apache Sling Servlet/Script resolver?

3. Do you see your servlet in an active state in OSGI components console?

Avatar

Avatar

mind119497

Avatar

mind119497

mind119497

13-03-2018

Thanks for the reply.

Here is the code for the servlet

@SlingServlet(paths = { "/services/all-sample" }, methods = { "GET", "POST" })
public class xxxxxxxx extends SlingAllMethodsServlet {
private static final long serialVersionUID = 1L;
private static final Logger logger = LoggerFactory.getLogger(xxxxxxxxx.class);

@Override
protected final void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
   throws ServletException, IOException {
  logger.info("Able to hit in");

}

@Override
protected final void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response)
   throws ServletException, IOException {
}

}

Have 2 bundles both activate state in console.

The same code able to access from the another bundle but trying to add servlets in the 2nd bundle. From the 2nd bundle not able to access the servlets.

Thanks

Uma

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

13-03-2018

Looks like you may not have registered it properly. Are you registering it by resource. Can you show the code you are using to reg the servlet.