Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Unable to access servlet

aradhyakasat
Level 2
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
BrianKasingli
Correct answer by
Community Advisor
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
BrianKasingli
Correct answer by
Community Advisor
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

aradhyakasat
Level 2
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
BrianKasingli
Community Advisor
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?
aradhyakasat
Level 2
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?
BrianKasingli
Community Advisor
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.
aradhyakasat
Level 2
Level 2
@BrianKasingli For option 1, you basically mean a maven build like mvn clean install -PauthoInstallSinglePackage. ?
SundeepKatepally
Level 5
Level 5

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