Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Upgrading a sling servlet from CQ 5.5 to AEM 6.2

Avatar

Level 2

Hi,

I have this old Pdf generation service which was written for cq 5.5. The service is based on a servlet written for 5.5. The issue is the servlet bundle seems to be active. on 6.2 But i am not able to invoke the servlet. i have no experience working on CQ 5.5.

I think the servlet needs to be rewritten completely. below is the servlet header.  In 5.5 the servlet path is actually under the /apps folder.

Also the source code is loaded in the apps folder and the transformation xsl is referenced from the /apps/src folder. The servlet is also bundled in a jar with the name - com.pdfservice.PDFService.

@SlingServlet(paths = { "/apps/csr/services/PdfBuilder.pdf" }, methods = { "GET" }, metatype = true)

@Properties( {

        @Property(name = "service.pid", value = "com.pdfservice.Service", propertyPrivate = false),

        @Property(name = "service.description", value = "A servlet used for generating PDFs from CQ5 templates.", propertyPrivate = false),

        @Property(name = "service.vendor", value = " Test Group- stp@testGroup.com", propertyPrivate = false) })

public class Service extends SlingAllMethodsServlet {

  private static final String XSL_PATH = "apps/csr/src/com.pdfservice.PDFService/src/issue-builder-transformation.xsl";

Can anyone please help on how to upgrade the servlet for compatibility with AEM 6.2.

Thanks,

Bhavani

3 Replies

Avatar

Level 2

The jar package is active in system/console/ and i can also see it system/console/components

Avatar

Level 10

The servlet should be rewritten using AEM 6.2 APIs - including using the AEM UBER 6.2 jar