When I switch Hibernate Search from 7.1.1 to 7.2.0 my Java 21 app won’t start.
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.hibernate.search.util.common.logging.impl.LoggerFactory.make(LoggerFactory.java:19)
The following method did not exist:
'java.lang.Object org.jboss.logging.Logger.getMessageLogger(java.lang.invoke.MethodHandles$Lookup, java.lang.Class, java.lang.String)'
The calling method's class, org.hibernate.search.util.common.logging.impl.LoggerFactory, was loaded from the following location:
jar:file:/G:/maven-repo/.m2/repository/org/hibernate/search/hibernate-search-util-common/7.2.0.Final/hibernate-search-util-common-7.2.0.Final.jar!/org/hibernate/search/util/common/logging/impl/LoggerFactory.class
The called method's class, org.jboss.logging.Logger, is available from the following locations:
jar:file:/G:/maven-repo/.m2/repository/org/jboss/logging/jboss-logging/3.5.3.Final/jboss-logging-3.5.3.Final.jar!/org/jboss/logging/Logger.class
The called method's class hierarchy was loaded from the following locations:
org.jboss.logging.Logger: file:/G:/maven-repo/.m2/repository/org/jboss/logging/jboss-logging/3.5.3.Final/jboss-logging-3.5.3.Final.jar
Action:
Correct the classpath of your application so that it contains compatible versions of the classes org.hibernate.search.util.common.logging.impl.LoggerFactory and org.jboss.logging.Logger
App
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.2</version>
<relativePath/>
</parent>
Hibernate Search
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-mapper-orm</artifactId>
<version>7.2.0.Final</version>
<exclusions>
<exclusion>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-backend-lucene</artifactId>
<version>7.2.0.Final</version>
</dependency>
Other dependencies worth to mention
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<version>6.6.0.Final</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.17.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.17.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.17.2</version>
</dependency>