Could not initialize GeoHashGridAggregationBuilder for elastic search 7.8.0

Hello,

I upgraded Elastic search version to 7.8.0. When I call ElasticSearchAPI I faced with "Caused By: java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.search.aggregations.bucket.geogrid.GeoHashGridAggregationBuilder" but when I check this file in jar I can see. Does anybody faced with such an issue could you please help me?

Thank you

Hi @ayse,

Could share the stack trace of the error and a snippet of the code you are trying to run? Those errors mean most of the time some issues with your dependencies.

Hi Ignacio,

"Root cause of ServletException.
org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.search.aggregations.bucket.geogrid.GeoHashGridAggregationBuilder"

You can see my dependencies as below

               ```
                     <dependency>
				        <groupId>org.elasticsearch</groupId>
				        <artifactId>elasticsearch</artifactId>
				        <version>7.8.0</version>
			         </dependency>
                     <dependency>
                        <groupId>org.elasticsearch.client</groupId>
                        <artifactId>x-pack-transport</artifactId>
                        <version>7.8.0</version>
                     </dependency>
		             <dependency>
				        <groupId>org.elasticsearch.client</groupId>
				        <artifactId>elasticsearch-rest-client</artifactId>
				        <version>7.8.0</version>
			         </dependency>
			         <dependency>
				        <groupId>org.elasticsearch.client</groupId>
				        <artifactId>elasticsearch-rest-high-level-client</artifactId>
				        <version>7.8.0</version>
			         </dependency>
			         <dependency>
                        <groupId>org.elasticsearch</groupId>
                        <artifactId>elasticsearch-geo</artifactId>
                        <version>7.8.0</version>
                      </dependency> 
       ```

This dependency does not exist, it might be the problem.

I think it is not about it because I used this for 7.6.2 version like this and also in the website it is explained like https://www.elastic.co/guide/en/elasticsearch/reference/7.8/setup-xpack-client.html

Yes, you are right if you set properly the repository. I tried myself creating a small project and I did not have any issues, so not sure I can help much more there.

My suspicion is that the issue is related to how dependencies are treated in the framework you are using and not elasticsearch.

@Ignacio_Vera Thank you for your response. I am trying to use this version with weblogic server can the problem be related to it? Should I add anything to pom.xml for it?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.