Upgrade from 7.1.1 to 7.2.0 throws exception(s)

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>

Hey @horvoje

that’s because of the mismatch in JBoss Logging dependency :confused:

please try adding the

<dependency>
    <groupId>org.jboss.logging</groupId>
    <artifactId>jboss-logging</artifactId>
    <version>3.6.0.Final</version>
</dependency>

to force the 3.6.0 version to be used (7.2 series - Hibernate Search)

1 Like

Thank you very much! That was really quick!
Also added exclude to be sure only one is used as dependency.

<properties>
	<hibernate-core.version>6.6.0.Final</hibernate-core.version>                       
	<hibernate-search-mapper-orm.version>7.2.0.Final</hibernate-search-mapper-orm.version>       
	<jboss-logging.version>3.6.0.Final</jboss-logging.version>
</properties>

<dependency>
	<groupId>org.hibernate.orm</groupId>
	<artifactId>hibernate-core</artifactId>
	<version>${hibernate-core.version}</version> <!--$NO-MVN-MAN-VER$-->
	<exclusions>
		<exclusion>
			<groupId>org.jboss.logging</groupId>
			<artifactId>jboss-logging</artifactId>
		</exclusion>
	</exclusions>
</dependency>

<dependency>
	<groupId>org.hibernate.search</groupId>
	<artifactId>hibernate-search-mapper-orm</artifactId>
	<version>${hibernate-search-mapper-orm.version}</version>
	<exclusions>
		<exclusion>
			<groupId>org.hibernate.orm</groupId>
			<artifactId>hibernate-core</artifactId>
		</exclusion>
		<exclusion>
			<groupId>org.jboss.logging</groupId>
			<artifactId>jboss-logging</artifactId>
		</exclusion>
	</exclusions>
</dependency>

<dependency>
	<groupId>org.hibernate.search</groupId>
	<artifactId>hibernate-search-backend-lucene</artifactId>
	<version>${hibernate-search-mapper-orm.version}</version>
	<exclusions>
		<exclusion>
			<groupId>org.jboss.logging</groupId>
			<artifactId>jboss-logging</artifactId>
		</exclusion>
	</exclusions>
</dependency>

<dependency>
	<groupId>org.jboss.logging</groupId>
	<artifactId>jboss-logging</artifactId>
	<version>${jboss-logging.version}</version> <!--$NO-MVN-MAN-VER$-->
</dependency>

Hi @mbekhta!
Maybe to put a hint into Migration Guide?
Because I did read Migration Guide before upgrade, but was not reading “What’s New”.

Yes, it’s a good idea to add it to the migration guide. I’ll add that to my todo. And sorry for the inconvenience :confused:

1 Like

No problem at all! Hibernate team and the support you guys provide is the best experience I had since 1982. when I started with development. <3

1 Like