Expand my Community achievements bar.

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

Unable to access servlet

Avatar

Level 2

So I have a aem project that I'm trying to run on a different machine. I just zipped my repository, unzipped it on the destination machine and did a maven build and deploy. I can see all my pages come up along with my components However I faced an issue. One of my custom components uses a servlet for populating a configuration dialog dropdown. It is linked with the cq:dialog using sling.servlet.resourceTypes. But the component is unable to populate the dropdown, probably because it is unable to access the servlet. Note, this works perfectly on the original machine. Just wanted to understand what possible gaps could there be?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@aradhyakasat,

There are numerous scenarios as to why your servlet is not running as expected, Can you please share your stack trace, error.log? 

View solution in original post

8 Replies

Avatar

Correct answer by
Community Advisor

@aradhyakasat,

There are numerous scenarios as to why your servlet is not running as expected, Can you please share your stack trace, error.log? 

Avatar

Level 2
@BrianKasingli I see no errors in the logs. Even on the frontend theres an empty space where my custom component is supposed to render. Just curious, if I've set my resourceType same as in the servlet, what could be the issue

Avatar

Community Advisor
can you please review your bundle, from http://localhost:4502/system/console/bundles. Is it active? Can you find your service registered within the bundle?

Avatar

Level 2
@BrianKasingli The core package is active, however I dont have my servlet running as a service, which I guess is the issue. Any fixes you can recommend?

Avatar

Community Advisor
You have 3 options. 1. if you have access to your source code repository, you can build code directly into your test environment. 2. if you have access to nexus, you can download the latest content package zip to install it into AEM package manager. 3. if you have access to nexus, you can download the latest BUNDLE.zip to install directly in the OSGI Apache Felix console. After upload & installation, assert to see if your servlet exist in the bundle.

Avatar

Level 2
@BrianKasingli For option 1, you basically mean a maven build like mvn clean install -PauthoInstallSinglePackage. ?

Avatar

Community Advisor

Firstly is it author or publish ?

 

is servlet path getting resolved ?

 

or is it getting resolved and throwing an error while executing ?

 

are your getting 4XX or 5XX error ?

 

is the servet using any system user which you dont have ?

 

are there 2 servlet in instance which has the same path. ?

 

If possible any stack trace if its 5XX issue