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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

OSGI Service development

Jai1122
Level 5
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
smacdonald2008
Correct answer by
Level 10
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
smacdonald2008
Correct answer by
Level 10
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

Ratna_Kumar
Community Advisor
Community Advisor

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.