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
BedrockMission!

Learn More

View all

Sign in to view all badges

Issue connecting to Zookeeper while establishing connection to Solr server.

Avatar

Avatar
Validate 1
MVP
Nikhil-Kumar
MVP

Likes

240 likes

Total Posts

253 posts

Correct Reply

38 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
MVP
Nikhil-Kumar
MVP

Likes

240 likes

Total Posts

253 posts

Correct Reply

38 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile
Nikhil-Kumar
MVP

19-08-2020

Hi @All,

I am trying to establish a connection with my Solr server zookeeper. I have taken reference from https://lucene.apache.org/solr/7_5_0/solr-solrj/org/apache/solr/client/solrj/impl/CloudSolrClient.Bu...

I am using following line of code snippet:

final List<String> zkServers = new ArrayList<String>();
zkServers.add("zookeeper1:2181"); zkServers.add("zookeeper2:2182"); zkServers.add("zookeeper3:2183");
final SolrClient client = new CloudSolrClient.Builder(zkServers, Optional.of("/solr")).build();

I tried using localhost instead of zookeeper1,2 and 3. As all three are in my same PC.

But I get following exception every time:

java.lang.NoClassDefFoundError: org/apache/zookeeper/KeeperException
	at org.apache.solr.client.solrj.impl.CloudSolrClient$Builder.build(CloudSolrClient.java:460)
	at com.bdb.aem.core.servlets.SolrConnection.getConnection(SolrConnection.java:36)
	at com.bdb.aem.core.servlets.SolrConnection.doGet(SolrConnection.java:29)
	at org.apache.sling.api.servlets.SlingSafeMethodsServlet.mayService(SlingSafeMethodsServlet.java:266)
	at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:342)
	at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:374)


When I debug CloudSolrClient.java:460 then I see it shows following value in Debug mode:

zk.PNG


Let me know where I am going wrong?

Thanks



Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,089 likes

Total Posts

3,123 posts

Correct Reply

1,063 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,089 likes

Total Posts

3,123 posts

Correct Reply

1,063 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

22-08-2020

What bundle in your AEM does provide you the org.apache.zookeeper packages? You can check on localhost:4502/system/console/depfinder, and by default AEM does not provide bundles with that code, you need to deploy it your instances yourself.

Answers (0)