Expand my Community achievements bar.

SOLVED

OSGI Service development

Avatar

Level 5

Hi Guys,

    I am trying to create a OSGI bundle in CRXDE  Lite. I have created a sling servlet in that bundle and it is working fine.

Now i want to create a OSGI Service and use it in the servlet. Can i create the Inteface and implementation class as siblings to sling servlet? If not Should i create a separate bundle for this?

The folder structure i follow is shown below (apologies for the format).

 

                                                                                                                           
apps        
 /project       
  /MyBundle     
   /MyBundle.bnd    
   src     
    main    
     java   
      com  
       test 
        Activator.java
        MySlingServlet.java
1 Accepted Solution

Avatar

Correct answer by
Level 10

Using CRXDE lite to create OSGi is not the recommended way. Now it's recommended that you use Maven and Adobe Archetype to build an OSGi bundle. See these communtiy articles. 

1 . Creating your first AEM Service using an Adobe Maven Archetype project (teaches you how to build an OSGi with Maven)

2. Submitting Adobe CQ form data to custom Sling Servlets (teaches you how to work with Servlets)

Also - see the AEM COmmuity support page for many more How Tos with AEM: https://helpx.adobe.com/marketing-cloud/experience-manager.html

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Using CRXDE lite to create OSGi is not the recommended way. Now it's recommended that you use Maven and Adobe Archetype to build an OSGi bundle. See these communtiy articles. 

1 . Creating your first AEM Service using an Adobe Maven Archetype project (teaches you how to build an OSGi with Maven)

2. Submitting Adobe CQ form data to custom Sling Servlets (teaches you how to work with Servlets)

Also - see the AEM COmmuity support page for many more How Tos with AEM: https://helpx.adobe.com/marketing-cloud/experience-manager.html

Avatar

Level 10

Hi,

As Scott stated, it is recommended that to build the OSGI bundle through Maven from Adobe Archetype project.

See the AEM support page as given by scott: https://helpx.adobe.com/marketing-cloud/experience-manager.html , as there are so many community articles based on Adobe Archetype to build OSGI bundle.

Thanks,
Ratna Kumar.