Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Unable to resolve Zookeeper dependency issues

Avatar

Level 2

Greetings !!

I was trying to implement the below exercise :

https://helpx.adobe.com/experience-manager/using/aem_solr64.html 

I just replaced the deprecated methods used in this exercise with the latest ones.

The build is successful. 

But after deployement, solr-plugin - Core bundle is in installed state due to following issues :

org.apache.zookeeper -- Cannot be resolved
org.apache.zookeeper.data -- Cannot be resolved
org.apache.zookeeper.server.auth -- Cannot be resolved
org.json,version=[20090211.0,20090212) from com.adobe.granite.bundles.json (50)
org.json.simple -- Cannot be resolved

 

I also tried adding latest and different versions of zookeeper in pom.xml. But the issue remains same.

I also tried converting zookeeper jar into bundle and then deploying the same on felix console. Still the same issue persists.

 

Thanks in advance for help !!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@SumanSatija4 -
After adding the dependency in Root pom.xml you need to follow below steps:

1. Add the dependency in the ui.app pom.xml :
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</dependency>

2. Ebed this dependency in ui.app pom.xml:
<embedded>
<groupId>org.apache.zookeeper</groupId>
<target>/apps/<project-name>/install</target>
<filter>true</filter>
</embedded>


This will definitely resolve your issue. Refer my article on converting a Jar to Bundle https://aemsimplifiedbynikhil.wordpress.com/2020/08/23/resolve-dependencies-by-converting-jar-to-bun...

 

Thanks,
Nikhil Kumar

View solution in original post

5 Replies

Avatar

Community Advisor

Hi @SumanSatija4,

Check if the zookeeper bundle that you created is active and is exporting the desired packages with expected version (Exported Packages section of your zookeeper bundle)

Avatar

Level 2
no it is not showing the exported packages.... I made below changes in pom.xml and now its working fine for me...

Avatar

Level 2
Import-Package Section add below packages: !com.ibm.*, !com.sun.*, !javax.jmdns.*, !javax.jms.*, !jline.*, !org.jboss.netty.*, !org.relaxng.datatype.*, *

Avatar

Community Advisor

@SumanSatija4,

You may need to take additional steps to make available the zookeeper library in the OSGI container by making it into a bundle. Try following Adobe's guide on how to convert a jar file into an OSGI bundle, and let me know how it goes, https://helpx.adobe.com/uk/experience-manager/kb/ConvertAJarIntoOsgiBundle.html

Once the libraries are available in the OSGI container, you should be able to see the org.apache.zookeeper library as a resolved bundle. 

Avatar

Correct answer by
Community Advisor

@SumanSatija4 -
After adding the dependency in Root pom.xml you need to follow below steps:

1. Add the dependency in the ui.app pom.xml :
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</dependency>

2. Ebed this dependency in ui.app pom.xml:
<embedded>
<groupId>org.apache.zookeeper</groupId>
<target>/apps/<project-name>/install</target>
<filter>true</filter>
</embedded>


This will definitely resolve your issue. Refer my article on converting a Jar to Bundle https://aemsimplifiedbynikhil.wordpress.com/2020/08/23/resolve-dependencies-by-converting-jar-to-bun...

 

Thanks,
Nikhil Kumar