Expand my Community achievements bar.

SOLVED

Find AEM out of box servlet

Avatar

Community Advisor

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 ?

1 Accepted Solution

Avatar

Correct answer by
Level 10

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.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

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.

Avatar

Administrator

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