When I try to upgrade Hibernate Search from 7.2.4 to 8.0.0 there is an error preventing application start:
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl.<init>(HibernateOrmIntegrationBooterImpl.java:75)
The following method did not exist:
'org.hibernate.models.spi.ModelsContext org.hibernate.boot.spi.BootstrapContext.getModelsContext()'
The calling method's class, org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl, was loaded from the following location:
jar:file:/C:/Users/Hrvoje/.m2/repository/org/hibernate/search/hibernate-search-mapper-orm/8.0.0.Final/hibernate-search-mapper-orm-8.0.0.Final.jar!/org/hibernate/search/mapper/orm/bootstrap/impl/HibernateOrmIntegrationBooterImpl.class
The called method's class, org.hibernate.boot.spi.BootstrapContext, is available from the following locations:
jar:file:/C:/Users/Hrvoje/.m2/repository/org/hibernate/orm/hibernate-core/6.6.15.Final/hibernate-core-6.6.15.Final.jar!/org/hibernate/boot/spi/BootstrapContext.class
The called method's class hierarchy was loaded from the following locations:
org.hibernate.boot.spi.BootstrapContext: file:/C:/Users/Hrvoje/.m2/repository/org/hibernate/orm/hibernate-core/6.6.15.Final/hibernate-core-6.6.15.Final.jar
Action:
Correct the classpath of your application so that it contains compatible versions of the classes org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl and org.hibernate.boot.spi.BootstrapContext
The only difference was:
BooleanPredicateClausesStep<?>
which I had to change to:
BooleanPredicateClausesStep<?,?>
Other versions are:
Java: 21
Spring Boot: 3.5.0
Hibernate 7.0.2.Final
hmm yeah … this looks like a problem with dependencies
You’d want
Hibernate ORM 7.0
Hibernate Search 8.0
Hibernate Models 1.0 (above two should take care of that, but versions in ORM 7.0.0 and Search 8.0.0 are different and things won’t work nicely if you don’t force the version Search expects) but since you are already at 8.0.0 and 7.0.2 this shouldn’t be a problem
Jakarta Persistence 3.2.0
I suspect that Spring brings its own versions of some of the above and it is causing the issues … try running mvn dependency:tree to see what ends up in your dependencies and from where it comes from..