Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

ResourceType Servlet is not working in AEM SDK

Avatar

Level 1

Hi All,

 

I tried installing the WKND project into my local SDK and tried to access the default servlet. I am getting "NO RESOURCE FOUND" error while accessing in the browser.

 

Please help me on this.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @shravanb2496924 ,

WKND Project comes with SimpleServlet.Java which has 

resourceTypes="wknd/components/page"

If you wish to access it with default servlet you may customize it like below

@Component(service = { Servlet.class })
@SlingServletResourceTypes(
resourceTypes="sling/servlet/default",
methods=HttpConstants.METHOD_GET,
extensions="txt")
@ServiceDescription("Simple Demo Servlet")

In this case you could be able to access servlet by visiting
http://localhost:4502/content/wknd/us/en.txt (Since .txt is an extension mentioned in above code snippet)


Make sure you are deploying project by right profile as below

mvn clean install -PautoInstallSinglePackage


Additionally, Please check if your WKND bundle is in Active state.
Reference: https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wknd-tutorial-devel...

Hope that helps!
Regards,
Santosh

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @shravanb2496924 ,

WKND Project comes with SimpleServlet.Java which has 

resourceTypes="wknd/components/page"

If you wish to access it with default servlet you may customize it like below

@Component(service = { Servlet.class })
@SlingServletResourceTypes(
resourceTypes="sling/servlet/default",
methods=HttpConstants.METHOD_GET,
extensions="txt")
@ServiceDescription("Simple Demo Servlet")

In this case you could be able to access servlet by visiting
http://localhost:4502/content/wknd/us/en.txt (Since .txt is an extension mentioned in above code snippet)


Make sure you are deploying project by right profile as below

mvn clean install -PautoInstallSinglePackage


Additionally, Please check if your WKND bundle is in Active state.
Reference: https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wknd-tutorial-devel...

Hope that helps!
Regards,
Santosh

Avatar

Community Advisor

Hi @shravanb2496924 ,  Please download & install this project aem-guides-wknd But it doesn't have any Servlets in it. Try to write your own servlet & see if it works or not. 

 

If this is not the issue, then please let us know which resourceType you are using.

 

~Aditya.

Thanks,

Aditya Chabuku