Convert jars to OSGi bundles | Community
Skip to main content
Level 2
May 16, 2019

Convert jars to OSGi bundles

  • May 16, 2019
  • 2 replies
  • 10640 views

Hi,

I have a maven dependency

<dependency>

    <groupId>org.apache.hive</groupId>

    <artifactId>hive-jdbc</artifactId>

    <version>2.1.1</version>

</dependency>

The jar and its dependencies don't have any OSGi bundle definition like symbolic bundle name under the manifest file. How do I convert it into OSGi bundle so that the jar and its dependencies can be successfully installed into AEM.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Adobe Employee
May 16, 2019

Check [1] on how to convert jar file to osgi bundle.

[1] How to Convert a jar File into an OSGi Bundle

Tapan1161Author
Level 2
May 16, 2019

Hi, this method applies only to jar that doesn't have any dependencies. hive-jdbc has dependency on 12 other jars. please suggest

joerghoh
Adobe Employee
Adobe Employee
May 16, 2019

tapana19997047​ What was the outcome of [1]? If you don't need to have this package in OSGI, you can also embedd it into your application bundle.

[1] AEM Hive error

Tapan1161Author
Level 2
May 21, 2019

I tried to embed the "hive-jdbc" jar into my application bundle. Following were the changes I did.

core pom.xml

ui-apps pom.xml

main pom.xml

However, the application bundle is in installed stage and found this in the error.log

Anything I am missing here?

AdobeID24
Level 5
July 22, 2022

check the bundle error ..if it is not active then other dependent dependencies are not resolved . you have to add all those dependencis also in class path of osgi bundle . 

 

Not sure if this also a good approch as if so many dependencies of the same jar your embed list will be getting increasing and untill and unless all dependent jar is not included in bundle classpath you have to keep on adding those .

 

If anyone having some better way please reply here ..will be helpful for community..

 

 

Another way of converting jar into bundle and then that bundle you can add in pacakge itself by adding inside content maven plugin scetion of pom.xml . with <embedded tag> and create isntall folder and add ur bundle in that location /app/../install/bundle,jar ....and once you will hit autoinstallpacakge it will deploy that custom bundle as well.