I get this error while compiling a Spring Boot application on 19.0.2 using spring-data-elasticsearch with the recent dependencies.
org.elasticsearch.search.aggregations.AbstractAggregationBuilder not found during compilation
./gradlew --version
------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------
Build time: 2023-03-03 16:41:37 UTC
Revision: 7d6581558e226a580d91d399f7dfb9e3095c2b1d
Kotlin: 1.8.10
Groovy: 3.0.13
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 19.0.2 (Private Build 19.0.2+7-Ubuntu-0ubuntu322.04)
OS: Linux 5.19.0-38-generic amd64
java --version
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04)
OpenJDK 64-Bit Server VM (build 19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing)
> Task :compileJava FAILED
An exception has occurred in the compiler (19.0.2). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for org.elasticsearch.search.aggregations.AbstractAggregationBuilder not found
>Solution :
org.elasticsearch.search.aggregations.AbstractAggregationBuilder was coming from the old Elasticsearch client libraries in version 7.17 and used with the NativeQueryBuilder and the Elasticsearch RestHighLevelClient.
For the new Elasticsearch client used in Spring Data Elasticsearch version 5.0 you will need to use the client classes from the elasticsearch-java client library like co.elastic.clients.elasticsearch._types.aggregations.Aggregation.