Find AEM out of box servlet | Community
Skip to main content
Himanshu_Singhal
Community Advisor
Community Advisor
January 18, 2016
Solved

Find AEM out of box servlet

  • January 18, 2016
  • 3 replies
  • 4822 views

Hi,

Inside /libs/cq/gui/components/authoring/clientlibs/assetfinder/js/image/ImageAssetPanel.js, there's a field imageServlet = '/bin/wcm/contentfinder/asset/view.html'.

Can we find out in which bundle this servlet code is present so we can de-compile and check out how this functionality is working from backend ?

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 edubey

Hi,

1. Go to http://localhost:4502/system/console/servletresolver and enter servlet path and click resolve,

You will see.

From class name you can get the idea of bundle like here

2. Go to Bundles tab and search for com.day.cq.wcm.core

3. Open bundle and search for class name ( from step 1) to ensure

4. See the bundle Id is 290

5. Go to this path in your system \crx-quickstart\launchpad\felix\bundle290\version0.0 you will get the jar which contains this classes.

3 replies

Level 3
January 18, 2016

felix provides a sling servlet resolver located at-

http://localhost:4502/system/console/servletresolver

edubey
edubeyAccepted solution
Level 10
January 18, 2016

Hi,

1. Go to http://localhost:4502/system/console/servletresolver and enter servlet path and click resolve,

You will see.

From class name you can get the idea of bundle like here

2. Go to Bundles tab and search for com.day.cq.wcm.core

3. Open bundle and search for class name ( from step 1) to ensure

4. See the bundle Id is 290

5. Go to this path in your system \crx-quickstart\launchpad\felix\bundle290\version0.0 you will get the jar which contains this classes.

kautuk_sahni
Community Manager
Community Manager
January 18, 2016

Hi

Find the Servlet

Next, we need to find the Servlet that implements /bin/wcm/references.json. Easy, there is a tool in the Felix Console that provides this mapping called the "Sling Servlet Resolver." Navigate tohttp://localhost:4502/system/console/servletresolver and enter /bin/wcm/references.json as the URL and click the "resolve" button. Immediately, we see that com.day.cq.wcm.core.impl.servlets.ReferenceSearchServlet is the implementing class.

Sling Servlet Resolver

Sling Servlet Resolver

Find the Bundle

The next step is a little trickier as we need to find the bundle that includes com.day.cq.wcm.core.impl.servlets.ReferenceSearchServlet. Fortunately, we are dealing with a Servlet, so it will be registered as an OSGi component. If we visit the Components section in Felix, http://localhost:4502/system/console/components, and search for, ReferenceSearchServlet, we quickly notice that this component is part of the com.day.cq.wcm.cq-wcm-core bundle.

Felix Components

Felix Components

Now, it's off to the Bundles section in Felix, http://localhost:4502/system/console/bundles. Search for com.day.cq.wcm.cq-wcm-core and take a look at the bundle properties. Notice that the jar for this bundle is located under /libs/wcm/core/install/cq-wcm-core-5.6.14.jar. Use either vault or create a package to obtain this JAR.

Felix Bundles

Felix Bundles

Link:- http://www.gastongonzalez.com/tech-blog/2014/10/18/aemcq-reverse-engineering-demystified

I hope this would help you.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni