Expand my Community achievements bar.

SOLVED

Dom4j bundle || unable to resolve in OSGI

Avatar

Level 2

Hi All,

 

We are trying to add org.dom4j maven dependency but the bundle is unable to resolve. (AEM version 6.5.6, jdk version - 1.8)

 

We have added below dependency
<dependency>
     <groupId>dom4j</groupId>
     <artifactId>dom4j</artifactId>
     <version>1.6.1</version>
     <scope>provided</scope>
     </dependency>

 

Also we have tried using,
<configuration>
<bnd><![CDATA[
                            <Embed-Dependency>dom4j</Embed-Dependency>
<Import-Package> javax.annotation;version=0.0.0,* </Import-Package>
                                ]]></bnd>
</configuration>

 

But no luck, could you please check and let us know if any inputs.

Thanks,
Sagar V

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hi @SagarVerliani,

 

1.One way to resolve is, If you added dependency to project and resolved in pom.xml in IDE in local,
go to your local repository .m2 folder (.m2\repository\log4j\log4j\1.2.12) get your jar according to dependency values and deploy it manually in OSGI Console.

 

GnanendraPonnala_1-1624949176137.png

 


2. The other way make use of Depfinder in OSGI console(http://localhost:4502/system/console/depfinder) to get required version of that bundle and download.

 

Thanks,

Gnanendra

 

View solution in original post

7 Replies

Avatar

Community Advisor

hi @SagarVerliani ,

 

You can simply use Eclipse plug-in project to convert the JAR into an OSGi bundle and deploy the bundle to AEM.
please refer below video

https://www.youtube.com/watch?v=EXyvsIknCLI

 

Also, attaching the bundle which i created. Try using this.

https://github.com/riteshmittal/dom4jbundle

 

Also, check the threads-

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/included-dependency-jar-is...

Avatar

Level 2

Hi @Ritesh_Mittal
After installing the jar from github, dom4j jar is in installed state only and also
getting this error logs

org.osgi.framework.BundleException: Unable to resolve dom4j-bundle [626](R 626.0): missing requirement [dom4j-bundle [626](R 626.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=15.0.0)) Unresolved requirements: [[dom4j-bundle [626](R 626.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=15.0.0))]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
at org.apache.felix.webconsole.internal.core.InstallHelper.doRun(InstallHelper.java:67) [org.apache.felix.webconsole:4.3.12]
at org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.doRun(BaseUpdateInstallHelper.java:99) [org.apache.felix.webconsole:4.3.12]
at org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.run(BaseUpdateInstallHelper.java:171) [org.apache.felix.webconsole:4.3.12]
at java.base/java.lang.Thread.run(Thread.java:834)
29.06.2021 13:01:02.575 *ERROR* [FelixDispatchQueue] dom4j-bundle FrameworkEvent ERROR (org.osgi.framework.BundleException: Unable to resolve dom4j-bundle [626](R 626.0): missing requirement [dom4j-bundle [626](R 626.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=15.0.0)) Unresolved requirements: [[dom4j-bundle [626](R 626.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=15.0.0))])
org.osgi.framework.BundleException: Unable to resolve dom4j-bundle [626](R 626.0): missing requirement [dom4j-bundle [626](R 626.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=15.0.0)) Unresolved requirements: [[dom4j-bundle [626](R 626.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=15.0.0))]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
at org.apache.felix.framework.Felix.setBundleStartLevel(Felix.java:1727)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:338)
at java.base/java.lang.Thread.run(Thread.java:834)
29.06.2021 13:01:02.578 *INFO* [OsgiInstallerImpl] org.apache.sling.installer.core.impl.tasks.BundleStartTask Could not start bundle barclays-ad-server.core [624]. Reason: {}. Will retry.

Avatar

Correct answer by
Level 2

Hi @SagarVerliani,

 

1.One way to resolve is, If you added dependency to project and resolved in pom.xml in IDE in local,
go to your local repository .m2 folder (.m2\repository\log4j\log4j\1.2.12) get your jar according to dependency values and deploy it manually in OSGI Console.

 

GnanendraPonnala_1-1624949176137.png

 


2. The other way make use of Depfinder in OSGI console(http://localhost:4502/system/console/depfinder) to get required version of that bundle and download.

 

Thanks,

Gnanendra

 

Avatar

Administrator
@GnanendraPonnala, Thank you for providing answer and assisting AEM community User. Keep the great work going.


Kautuk Sahni

Avatar

Community Advisor

Hi @SagarVerliani,

Per the snippets you shared in your original post, could see that you have used "Embed-Dependency" entry in bnd-maven-plugin. (while the same is applicable for maven-bundle-plugin

 

In case you are using maven-bundle-plugin as part of code package (core module), Have the desired dependency entry in core and main pom.xml and in plugin definition add the below.

<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency> // "*" Denotes all dependency as part of <dependencies> entry in pom.xml
<Embed-Transitive>true</Embed-Transitive> // Includes RunTime/compile time dependencies of each of the dependency in turn. Example: all Run time dependencies of org.dom4j

For bnd-maven-plugin