Value involves formulas after moving from Hibernate 5 to Hibernate 6

Hey, guys!
I’m working on the migration of my project from Spring Boot 2.7.2 to Spring Boot 3.1.1.
I have faced an issue with spring search and @Formula. Before migration my code worked well, but after update it gives me errors. I took a minimum count of code to reproduce error.
I need “fullName” column for simple search via spring repository.
Maybe I missed something in migration guidelines but I didn’t find any information about changes for @Formula.
Probably this issue is something really simple, but I couldn’t fix it :frowning:
It would be great if you will help me. Thx

Error text:

2023-07-05T21:42:12.569+03:00 ERROR 2812 --- [           main] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [full_name] in table [user]
2023-07-05T21:42:12.571+03:00  WARN 2812 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [full_name] in table [user]
2023-07-05T21:42:12.571+03:00  INFO 2812 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2023-07-05T21:42:12.574+03:00  INFO 2812 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
2023-07-05T21:42:12.576+03:00  INFO 2812 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2023-07-05T21:42:12.589+03:00  INFO 2812 --- [           main] .s.b.a.l.ConditionEvaluationReportLogger : 

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-07-05T21:42:12.609+03:00 ERROR 2812 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [full_name] in table [user]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-6.0.10.jar:6.0.10]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:931) ~[spring-context-6.0.10.jar:6.0.10]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) ~[spring-context-6.0.10.jar:6.0.10]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:436) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-3.1.1.jar:3.1.1]
	at com.bubalex.hibara.HibaraApplication.main(HibaraApplication.java:10) ~[classes/:na]
Caused by: jakarta.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [full_name] in table [user]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:421) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:352) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1816) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1766) ~[spring-beans-6.0.10.jar:6.0.10]
	... 16 common frames omitted
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [full_name] in table [user]
	at org.hibernate.tool.schema.internal.AbstractSchemaValidator.validateTable(AbstractSchemaValidator.java:145) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.tool.schema.internal.GroupedSchemaValidatorImpl.validateTables(GroupedSchemaValidatorImpl.java:46) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.tool.schema.internal.AbstractSchemaValidator.performValidation(AbstractSchemaValidator.java:97) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.tool.schema.internal.AbstractSchemaValidator.doValidation(AbstractSchemaValidator.java:75) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:293) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.lambda$process$5(SchemaManagementToolCoordinator.java:143) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at java.base/java.util.HashMap.forEach(HashMap.java:1429) ~[na:na]
	at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:140) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.boot.internal.SessionFactoryObserverForSchemaExport.sessionFactoryCreated(SessionFactoryObserverForSchemaExport.java:37) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:292) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:431) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1455) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:75) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.10.jar:6.0.10]
	... 20 common frames omitted

If I will remove “@Column” from fullName I will get another error:

Caused by: org.hibernate.search.util.common.SearchException: HSEARCH000520: Hibernate Search encountered failures during bootstrap. Failures:

    Hibernate ORM mapping: 
        type 'com.bubalex.hibara.CaseEntity': 
            path '.userRoles<collection>.user<no value extractors>.email<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.firstName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.lastName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.phoneNumber<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>': 
                failures: 
                  - value involves formulas
	at org.hibernate.search.engine.reporting.spi.RootFailureCollector.checkNoFailure(RootFailureCollector.java:53) ~[hibernate-search-engine-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.engine.common.impl.SearchIntegrationBuilder.prepareBuild(SearchIntegrationBuilder.java:191) ~[hibernate-search-engine-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateSearchPreIntegrationService$NotBooted.doBootFirstPhase(HibernateSearchPreIntegrationService.java:258) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl.bootNow(HibernateOrmIntegrationBooterImpl.java:177) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2179) ~[na:na]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:41) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:292) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:431) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1455) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:75) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.10.jar:6.0.10]
	... 19 common frames omitted

Here is my pom file:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.1.1</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.bubalex</groupId>
    <artifactId>hibara</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>hibara</name>
    <description>hibara</description>
    <properties>
        <java.version>20</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.search</groupId>
            <artifactId>hibernate-search-mapper-orm-orm6</artifactId>
            <version>6.2.0.Beta1</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate.search</groupId>
            <artifactId>hibernate-search-backend-lucene</artifactId>
            <version>6.2.0.Beta1</version>
        </dependency>

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <forceJavacCompilerUse>true</forceJavacCompilerUse>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.hibernate.orm</groupId>
                            <artifactId>hibernate-jpamodelgen</artifactId>
                            <version>6.2.6.Final</version>
                        </path>
                    </annotationProcessorPaths>
                    <showWarnings>true</showWarnings>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

Here is my config:

spring.datasource.driver-class-name=org.postgresql.Driver
spring.sql.init.platform=postgresql
spring.datasource.url=jdbc:postgresql://localhost:5435/db_name?currentSchema=schema
spring.datasource.username=postgres
spring.datasource.password=pass

# ORM/JPA configuration
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=validate
spring.jpa.properties.hibernate.default_schema=schema
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.properties.hibernate.use_sql_comments=true
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.jdbc.batch_size=5
spring.jpa.properties.hibernate.order_inserts=true
spring.jpa.properties.hibernate.order_updates=true

# Hibernate search properties
spring.jpa.properties.hibernate.search.backend.directory.type=local-filesystem
spring.jpa.properties.hibernate.search.backend.type=lucene
spring.jpa.properties.hibernate.search.backend.directory.root=./data/lucene
spring.jpa.properties.hibernate.search.backend.analysis.configurer=class:com.bubalex.hibara.VisalexFulltextSearchAnalysisConfigurer

package com.bubalex.hibara;

import jakarta.persistence.EntityManagerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class PersistenceConfiguration {

    /**
     * Starts full text indexing
     *
     * @param entityManagerFactory entity manager factory
     * @return instance of the class for full text indexing run
     */
    @Bean
    public LuceneIndexServiceBean luceneIndexServiceBean(EntityManagerFactory entityManagerFactory) {
        LuceneIndexServiceBean luceneIndexServiceBean = new LuceneIndexServiceBean(entityManagerFactory);
        luceneIndexServiceBean.triggerIndexing();

        return luceneIndexServiceBean;
    }
}

package com.bubalex.hibara;

import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.search.mapper.orm.Search;
import org.hibernate.search.mapper.orm.massindexing.MassIndexer;
import org.hibernate.search.mapper.orm.session.SearchSession;
import org.springframework.transaction.annotation.Transactional;

/**
 * Requires for indexing.
 */
@Slf4j
@Transactional
public class LuceneIndexServiceBean {

    private final EntityManager entityManager;

    public LuceneIndexServiceBean(EntityManagerFactory entityManagerFactory) {
        this.entityManager = entityManagerFactory.createEntityManager();
    }

    /**
     * Starts indexing.
     */
    public void triggerIndexing() {
        try {
            SearchSession searchSession = Search.session(entityManager);
            MassIndexer indexer =
                    searchSession
                            .massIndexer()
                            .limitIndexedObjectsTo(15000)
                            .idFetchSize(15000)
                            .batchSizeToLoadObjects(2500)
                            .threadsToLoadObjects(Runtime.getRuntime().availableProcessors());

            indexer.startAndWait();
        } catch (InterruptedException e) {
           // log.error("Thread interrupted during full text indexing process", e);
            Thread.currentThread().interrupt();
        }
    }

}

package com.bubalex.hibara;

import org.apache.lucene.analysis.core.LowerCaseFilterFactory;
import org.apache.lucene.analysis.ngram.NGramFilterFactory;
import org.apache.lucene.analysis.ngram.NGramTokenizerFactory;
import org.hibernate.search.backend.lucene.analysis.LuceneAnalysisConfigurationContext;
import org.hibernate.search.backend.lucene.analysis.LuceneAnalysisConfigurer;

public class VisalexFulltextSearchAnalysisConfigurer implements LuceneAnalysisConfigurer {

    @Override
    public void configure(LuceneAnalysisConfigurationContext luceneAnalysisConfigurationContext) {
        luceneAnalysisConfigurationContext.analyzer("ngram").custom()
                .tokenizer(NGramTokenizerFactory.class)
                .tokenFilter(NGramFilterFactory.class)
                .param("minGramSize", "1")
                .param("maxGramSize", "4")
                .tokenFilter(LowerCaseFilterFactory.class);
    }
}

package com.bubalex.hibara;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.hibernate.Hibernate;
import org.hibernate.search.engine.backend.types.Aggregable;
import org.hibernate.search.engine.backend.types.Searchable;
import org.hibernate.search.engine.backend.types.Sortable;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField;

import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Objects;
import java.util.UUID;

/**
 * The base implementation of a persisted entity.
 */
@Getter
@Setter
@SuperBuilder
@MappedSuperclass
@NoArgsConstructor
public abstract class BaseEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.UUID)
    @GenericField(sortable = Sortable.NO, aggregable = Aggregable.YES, searchable = Searchable.YES)
    @Column(name = "id")
    private UUID id;

    @Column(name = "created_at", updatable = false)
    private Instant createdAt;

    @Column(name = "updated_at")
    private Instant updatedAt;

    @Column(name = "is_deleted")
    private Boolean deleted;

}
package com.bubalex.hibara;

import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.Formula;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField;

import java.time.LocalDate;


@Table(name = "user")
@Entity
@Getter
@Setter
@Where(clause = "is_deleted = false")
@SQLDelete(sql = "UPDATE visalex.user SET is_deleted = true WHERE id = ?")
@Inheritance(strategy = InheritanceType.JOINED)
@NoArgsConstructor
@AllArgsConstructor
public class UserEntity extends BaseTenantEntity {

    @Setter(AccessLevel.NONE)
    @Column(updatable = false)
    @Formula("concat(first_name,' ',last_name)")
    private String fullName;

    /**
     * The email of the user. Used for authenticating the user.
     */
    @FullTextField
    @Column(name = "email", unique = true)
    private String email;

    /**
     * The first name of the user.
     */
    @FullTextField
    @Column(name = "first_name")
    private String firstName;

    /**
     * The last name of the user.
     */
    @FullTextField
    @Column(name = "last_name")
    private String lastName;

    /**
     * The last name of the user.
     */
    @FullTextField
    @Column(name = "middle_name")
    private String middleName;

    @FullTextField
    @Column(name = "phone_number")
    private String phoneNumber;


}

package com.bubalex.hibara;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.Generated;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import org.hibernate.annotations.Where;
import org.hibernate.generator.EventType;

@Table(name = "client")
@Where(clause = "is_deleted = false")
@Entity
@Setter
@Getter
@OnDelete(action = OnDeleteAction.CASCADE)
@NoArgsConstructor
@AllArgsConstructor
@PrimaryKeyJoinColumn(name = "id")
public class ClientEntity extends UserEntity {

    @Generated(event = EventType.INSERT)
    @SequenceGenerator(name = "client_order_number_seq", sequenceName = "client_order_number_seq", allocationSize = 1)
    @Column(name = "order_number", insertable = false, updatable = false)
    private Integer orderNumber;

    /**
     * The language of the client.
     */
    @Column(name = "language")
    private String language;

    /**
     * The lead source of the client.
     */
    @Column(name = "lead_source")
    private String leadSource;


    @Column(name = "company_name")
    private String companyName;

    @Column(name = "position")
    private String position;
}


package com.bubalex.hibara;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.Generated;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import org.hibernate.annotations.Where;
import org.hibernate.generator.EventType;

@Table(name = "employee")
@Where(clause = "is_deleted = false")
@Entity
@Setter
@Getter
@OnDelete(action = OnDeleteAction.CASCADE)
@NoArgsConstructor
@AllArgsConstructor
@PrimaryKeyJoinColumn(name = "id")
public class EmployeeEntity extends UserEntity {

    @Generated(event = EventType.INSERT)
    @SequenceGenerator(name = "employee_order_number_seq", sequenceName = "employee_order_number_seq", allocationSize = 1)
    @Column(name = "order_number", insertable = false, updatable = false)
    private Integer orderNumber;

    @Column(name = "consultation_languages")
    private String consultationLanguages = "EN";

    /**
     * The job title of the employee.
     */
    @Column(name = "job_title")
    private String jobTitle;

}

Full code could be found here:
https://github.com/Nomad06/hibara

Hello,

@Formula means the value is computed on the database side before loading the entity in your JVM, so I wouldn’t advise indexing it. It might become out-of-date after you make changes to your entity.

I’d recommend something like this instead:

    @Transient 
    @FullTextField
    @IndexingDependency(derivedFrom = {
        @ObjectPath(@PropertyValue(propertyName = "firstName")),
        @ObjectPath(@PropertyValue(propertyName = "lastName"))
    })
    public String getFullName() {
        return firstName + " " + lastName;
    }

See Hibernate Search 6.2.2.Final: Reference Documentation

Regardless, I agree the error message is not great, so at the very least that should be improved.

Can you check your logs before that error? There should be multiple ERROR logs with full stack traces.

This link is dead. Probably a private project?


By the way, this is a big red flag:

You should not hold to an entity manager instance for the duration of your session.

I’d recommend that you remove your luceneIndexServiceBean method and change LuceneIndexServiceBean to look like this:

@Slf4j
@Transactional
@Component
public class LuceneIndexServiceBean {

    @PersistenceContext // Or @Autowired, I don't remember how it works in Spring
    private EntityManager entityManager;

    public LuceneIndexServiceBean() {
    }

Then the entity manager will be a proxy to an actual entity manager that will get opened and closed as necessary by Spring.

Hey, yrodiere!
Thx for your answer!
Sorry for private repo. Now it’s open.
I don’t want to use fullName for indexing for fulltext search. I’m just using it for simple requests via jpa.
LuceneIndexServiceBean is bad and I changed it according your remarks :slight_smile:

Can you check your logs before that error? There should be multiple ERROR logs with full stack traces.

2023-07-07T16:52:45.118+03:00 ERROR 32420 --- [           main] org.hibernate.AssertionFailure           : HHH000099: an assertion failure occurred (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): org.hibernate.AssertionFailure: value involves formulas
2023-07-07T16:52:45.118+03:00 ERROR 32420 --- [           main] o.h.s.e.r.spi.RootFailureCollector       : HSEARCH000521: Hibernate Search encountered a failure during bootstrap; continuing for now to list all problems, but the process will ultimately be aborted.
Context: Hibernate ORM mapping, type 'com.bubalex.hibara.CaseEntity', path '.userRoles<collection>.user<no value extractors>'
Failure:

org.hibernate.AssertionFailure: value involves formulas
	at org.hibernate.mapping.SimpleValue.getColumns(SimpleValue.java:282) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.search.mapper.orm.mapping.impl.HibernateOrmMappingPropertiesMetadataContributor.collectScale(HibernateOrmMappingPropertiesMetadataContributor.java:99) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.orm.mapping.impl.HibernateOrmMappingPropertiesMetadataContributor.collectMetadataFromHibernateOrmMappingProperty(HibernateOrmMappingPropertiesMetadataContributor.java:94) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.orm.mapping.impl.HibernateOrmMappingPropertiesMetadataContributor.lambda$contributeAdditionalMetadata$0(HibernateOrmMappingPropertiesMetadataContributor.java:54) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.model.additionalmetadata.building.impl.PojoTypeAdditionalMetadataBuilder.lambda$build$1(PojoTypeAdditionalMetadataBuilder.java:102) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.model.additionalmetadata.impl.PojoTypeAdditionalMetadata.lambda$getPropertyAdditionalMetadata$0(PojoTypeAdditionalMetadata.java:63) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1228) ~[na:na]
	at org.hibernate.search.mapper.pojo.model.additionalmetadata.impl.PojoTypeAdditionalMetadata.getPropertyAdditionalMetadata(PojoTypeAdditionalMetadata.java:58) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.automaticindexing.building.impl.PojoAssociationPathInverter.findInverseSidePathFromInverseSideRecursive(PojoAssociationPathInverter.java:191) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.automaticindexing.building.impl.PojoAssociationPathInverter.findInverseSidePathFromInverseSide(PojoAssociationPathInverter.java:172) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.automaticindexing.building.impl.PojoAssociationPathInverter.invertPath(PojoAssociationPathInverter.java:65) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.automaticindexing.building.impl.PojoIndexingDependencyCollectorTypeNode.collectDependency(PojoIndexingDependencyCollectorTypeNode.java:182) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.automaticindexing.building.impl.PojoIndexingDependencyCollectorMonomorphicDirectValueNode.doCollectDependency(PojoIndexingDependencyCollectorMonomorphicDirectValueNode.java:92) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.automaticindexing.building.impl.PojoIndexingDependencyCollectorMonomorphicDirectValueNode.collectDependency(PojoIndexingDependencyCollectorMonomorphicDirectValueNode.java:66) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.PojoIndexingProcessorValueNodeBuilderDelegate.doBuild(PojoIndexingProcessorValueNodeBuilderDelegate.java:194) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.PojoIndexingProcessorValueNodeBuilderDelegate.build(PojoIndexingProcessorValueNodeBuilderDelegate.java:166) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.PojoIndexingProcessorPropertyNodeBuilder.doBuild(PojoIndexingProcessorPropertyNodeBuilder.java:177) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.PojoIndexingProcessorPropertyNodeBuilder.build(PojoIndexingProcessorPropertyNodeBuilder.java:155) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.AbstractPojoIndexingProcessorTypeNodeBuilder.lambda$doBuild$0(AbstractPojoIndexingProcessorTypeNodeBuilder.java:127) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[na:na]
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1921) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[na:na]
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[na:na]
	at org.hibernate.search.mapper.pojo.processing.building.impl.AbstractPojoIndexingProcessorTypeNodeBuilder.doBuild(AbstractPojoIndexingProcessorTypeNodeBuilder.java:130) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.AbstractPojoIndexingProcessorTypeNodeBuilder.build(AbstractPojoIndexingProcessorTypeNodeBuilder.java:97) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.AbstractPojoIndexingProcessorTypeNodeBuilder.build(AbstractPojoIndexingProcessorTypeNodeBuilder.java:92) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.PojoIndexingProcessorValueNodeBuilderDelegate.lambda$doBuild$1(PojoIndexingProcessorValueNodeBuilderDelegate.java:188) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[na:na]
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[na:na]
	at org.hibernate.search.mapper.pojo.processing.building.impl.PojoIndexingProcessorValueNodeBuilderDelegate.doBuild(PojoIndexingProcessorValueNodeBuilderDelegate.java:191) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.PojoIndexingProcessorValueNodeBuilderDelegate.build(PojoIndexingProcessorValueNodeBuilderDelegate.java:166) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.PojoIndexingProcessorContainerElementNodeBuilder.doBuild(PojoIndexingProcessorContainerElementNodeBuilder.java:84) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.PojoIndexingProcessorContainerElementNodeBuilder.build(PojoIndexingProcessorContainerElementNodeBuilder.java:73) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.PojoIndexingProcessorPropertyNodeBuilder.lambda$doBuild$0(PojoIndexingProcessorPropertyNodeBuilder.java:184) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[na:na]
	at java.base/java.util.stream.DistinctOps$1$2.accept(DistinctOps.java:174) ~[na:na]
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[na:na]
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1921) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[na:na]
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[na:na]
	at org.hibernate.search.mapper.pojo.processing.building.impl.PojoIndexingProcessorPropertyNodeBuilder.doBuild(PojoIndexingProcessorPropertyNodeBuilder.java:187) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.PojoIndexingProcessorPropertyNodeBuilder.build(PojoIndexingProcessorPropertyNodeBuilder.java:155) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.AbstractPojoIndexingProcessorTypeNodeBuilder.lambda$doBuild$0(AbstractPojoIndexingProcessorTypeNodeBuilder.java:127) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[na:na]
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1921) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[na:na]
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[na:na]
	at org.hibernate.search.mapper.pojo.processing.building.impl.AbstractPojoIndexingProcessorTypeNodeBuilder.doBuild(AbstractPojoIndexingProcessorTypeNodeBuilder.java:130) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.processing.building.impl.AbstractPojoIndexingProcessorTypeNodeBuilder.build(AbstractPojoIndexingProcessorTypeNodeBuilder.java:97) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.mapping.building.impl.PojoIndexedTypeManagerBuilder.preBuild(PojoIndexedTypeManagerBuilder.java:117) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.pojo.mapping.building.impl.PojoMapper.prepareBuild(PojoMapper.java:277) ~[hibernate-search-mapper-pojo-base-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.engine.common.impl.SearchIntegrationBuilder$MappingBuildingState.partiallyBuildAndAddTo(SearchIntegrationBuilder.java:287) ~[hibernate-search-engine-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.engine.common.impl.SearchIntegrationBuilder.prepareBuild(SearchIntegrationBuilder.java:188) ~[hibernate-search-engine-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateSearchPreIntegrationService$NotBooted.doBootFirstPhase(HibernateSearchPreIntegrationService.java:258) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl.bootNow(HibernateOrmIntegrationBooterImpl.java:177) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2179) ~[na:na]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:41) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:292) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:431) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1455) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:75) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:352) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1816) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1766) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-6.0.10.jar:6.0.10]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:931) ~[spring-context-6.0.10.jar:6.0.10]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) ~[spring-context-6.0.10.jar:6.0.10]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:436) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-3.1.1.jar:3.1.1]
	at com.bubalex.hibara.HibaraApplication.main(HibaraApplication.java:10) ~[classes/:na]

2023-07-07T16:52:45.138+03:00 ERROR 32420 --- [           main] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.search.util.common.SearchException: HSEARCH000520: Hibernate Search encountered failures during bootstrap. Failures:

    Hibernate ORM mapping: 
        type 'com.bubalex.hibara.CaseEntity': 
            path '.userRoles<collection>.user<no value extractors>.email<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.firstName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.lastName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.phoneNumber<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>': 
                failures: 
                  - value involves formulas
2023-07-07T16:52:45.139+03:00  WARN 32420 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.search.util.common.SearchException: HSEARCH000520: Hibernate Search encountered failures during bootstrap. Failures:

    Hibernate ORM mapping: 
        type 'com.bubalex.hibara.CaseEntity': 
            path '.userRoles<collection>.user<no value extractors>.email<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.firstName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.lastName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.phoneNumber<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>': 
                failures: 
                  - value involves formulas
2023-07-07T16:52:45.140+03:00  INFO 32420 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2023-07-07T16:52:45.145+03:00  INFO 32420 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
2023-07-07T16:52:45.153+03:00  INFO 32420 --- [           main] .s.b.a.l.ConditionEvaluationReportLogger : 

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-07-07T16:52:45.171+03:00 ERROR 32420 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.search.util.common.SearchException: HSEARCH000520: Hibernate Search encountered failures during bootstrap. Failures:

    Hibernate ORM mapping: 
        type 'com.bubalex.hibara.CaseEntity': 
            path '.userRoles<collection>.user<no value extractors>.email<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.firstName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.lastName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.phoneNumber<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>': 
                failures: 
                  - value involves formulas
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-6.0.10.jar:6.0.10]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:931) ~[spring-context-6.0.10.jar:6.0.10]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) ~[spring-context-6.0.10.jar:6.0.10]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:436) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-3.1.1.jar:3.1.1]
	at com.bubalex.hibara.HibaraApplication.main(HibaraApplication.java:10) ~[classes/:na]
Caused by: jakarta.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.search.util.common.SearchException: HSEARCH000520: Hibernate Search encountered failures during bootstrap. Failures:

    Hibernate ORM mapping: 
        type 'com.bubalex.hibara.CaseEntity': 
            path '.userRoles<collection>.user<no value extractors>.email<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.firstName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.lastName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.phoneNumber<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>': 
                failures: 
                  - value involves formulas
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:421) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:352) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1816) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1766) ~[spring-beans-6.0.10.jar:6.0.10]
	... 15 common frames omitted
Caused by: org.hibernate.search.util.common.SearchException: HSEARCH000520: Hibernate Search encountered failures during bootstrap. Failures:

    Hibernate ORM mapping: 
        type 'com.bubalex.hibara.CaseEntity': 
            path '.userRoles<collection>.user<no value extractors>.email<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.firstName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.lastName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.phoneNumber<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>': 
                failures: 
                  - value involves formulas
	at org.hibernate.search.engine.reporting.spi.RootFailureCollector.checkNoFailure(RootFailureCollector.java:53) ~[hibernate-search-engine-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.engine.common.impl.SearchIntegrationBuilder.prepareBuild(SearchIntegrationBuilder.java:191) ~[hibernate-search-engine-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateSearchPreIntegrationService$NotBooted.doBootFirstPhase(HibernateSearchPreIntegrationService.java:258) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl.bootNow(HibernateOrmIntegrationBooterImpl.java:177) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2179) ~[na:na]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:41) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:292) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:431) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1455) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:75) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.10.jar:6.0.10]
	... 19 common frames omitted


Process finished with exit code 1

Can you try with Hibernate Search 6.2.0.Final or 6.2.0.CR1?

EDIT: If it still doesn’t work, I’ll let @mbekhta have a look (please!) since I won’t be available for a while.

1 Like

Tried to use 6.2.0.Final and also 6.2.0.CR1

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-07-07T17:41:15.628+03:00 ERROR 3612 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.search.util.common.SearchException: HSEARCH000520: Hibernate Search encountered failures during bootstrap. Failures:

    Hibernate ORM mapping: 
        type 'com.bubalex.hibara.CaseEntity': 
            path '.userRoles<collection>.user<no value extractors>.email<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.firstName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.lastName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.phoneNumber<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>': 
                failures: 
                  - value involves formulas
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-6.0.10.jar:6.0.10]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:931) ~[spring-context-6.0.10.jar:6.0.10]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) ~[spring-context-6.0.10.jar:6.0.10]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:436) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-3.1.1.jar:3.1.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-3.1.1.jar:3.1.1]
	at com.bubalex.hibara.HibaraApplication.main(HibaraApplication.java:10) ~[classes/:na]
Caused by: jakarta.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.search.util.common.SearchException: HSEARCH000520: Hibernate Search encountered failures during bootstrap. Failures:

    Hibernate ORM mapping: 
        type 'com.bubalex.hibara.CaseEntity': 
            path '.userRoles<collection>.user<no value extractors>.email<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.firstName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.lastName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.phoneNumber<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>': 
                failures: 
                  - value involves formulas
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:421) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:352) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1816) ~[spring-beans-6.0.10.jar:6.0.10]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1766) ~[spring-beans-6.0.10.jar:6.0.10]
	... 15 common frames omitted
Caused by: org.hibernate.search.util.common.SearchException: HSEARCH000520: Hibernate Search encountered failures during bootstrap. Failures:

    Hibernate ORM mapping: 
        type 'com.bubalex.hibara.CaseEntity': 
            path '.userRoles<collection>.user<no value extractors>.email<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.firstName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.lastName<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>.phoneNumber<no value extractors>': 
                failures: 
                  - value involves formulas
            path '.userRoles<collection>.user<no value extractors>': 
                failures: 
                  - value involves formulas
	at org.hibernate.search.engine.reporting.spi.RootFailureCollector.checkNoFailure(RootFailureCollector.java:53) ~[hibernate-search-engine-6.2.0.Final.jar:6.2.0.Final]
	at org.hibernate.search.engine.common.impl.SearchIntegrationBuilder.prepareBuild(SearchIntegrationBuilder.java:192) ~[hibernate-search-engine-6.2.0.Final.jar:6.2.0.Final]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateSearchPreIntegrationService$NotBooted.doBootFirstPhase(HibernateSearchPreIntegrationService.java:259) ~[hibernate-search-mapper-orm-orm6-6.2.0.Final.jar:6.2.0.Final]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl.bootNow(HibernateOrmIntegrationBooterImpl.java:179) ~[hibernate-search-mapper-orm-orm6-6.2.0.Final.jar:6.2.0.Final]
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2179) ~[na:na]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:41) ~[hibernate-search-mapper-orm-orm6-6.2.0.Final.jar:6.2.0.Final]
	at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:292) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:431) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1455) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:75) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.10.jar:6.0.10]
	... 19 common frames omitted

Disconnected from the target VM, address: '127.0.0.1:55801', transport: 'socket'

Process finished with exit code 1

mm ok :smiley: I’ve checked and I can see your repository with the reproducer. I’ll get back to you once I’ll take a look.

hey @Nomad06, have you pushed all the changes to that reproducer repository? I’ve tried to run it, and I’m not getting the error you’ve mentioned; instead, there’s this one:

Caused by: org.hibernate.search.util.common.SearchException: HSEARCH000520: Hibernate Search encountered failures during bootstrap. Failures:

    Hibernate ORM mapping: 
        type 'com.bubalex.hibara.CaseEntity': 
            path '.userRoles<collection>.user<no value extractors>.email<no value extractors>': 
                failures: 
                  - HSEARCH700020: Unable to find the inverse side of the association on type 'com.bubalex.hibara.UserRoleEntity' at path '.user<no value extractors>'. Hibernate Search needs this information in order to reindex 'com.bubalex.hibara.UserRoleEntity' when 'com.bubalex.hibara.UserEntity' is modified. You can solve this error by defining the inverse side of this association,  either with annotations specific to your integration (@OneToMany(mappedBy = ...) in Hibernate ORM)  or with the Hibernate Search @AssociationInverseSide annotation. Alternatively, if you do not need to reindex 'com.bubalex.hibara.UserRoleEntity' when 'com.bubalex.hibara.UserEntity' is modified, you can disable automatic reindexing with @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW).
            path '.userRoles<collection>.user<no value extractors>.firstName<no value extractors>': 
                failures: 
                  - HSEARCH700020: Unable to find the inverse side of the association on type 'com.bubalex.hibara.UserRoleEntity' at path '.user<no value extractors>'. Hibernate Search needs this information in order to reindex 'com.bubalex.hibara.UserRoleEntity' when 'com.bubalex.hibara.UserEntity' is modified. You can solve this error by defining the inverse side of this association,  either with annotations specific to your integration (@OneToMany(mappedBy = ...) in Hibernate ORM)  or with the Hibernate Search @AssociationInverseSide annotation. Alternatively, if you do not need to reindex 'com.bubalex.hibara.UserRoleEntity' when 'com.bubalex.hibara.UserEntity' is modified, you can disable automatic reindexing with @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW).
            path '.userRoles<collection>.user<no value extractors>.lastName<no value extractors>': 
                failures: 
                  - HSEARCH700020: Unable to find the inverse side of the association on type 'com.bubalex.hibara.UserRoleEntity' at path '.user<no value extractors>'. Hibernate Search needs this information in order to reindex 'com.bubalex.hibara.UserRoleEntity' when 'com.bubalex.hibara.UserEntity' is modified. You can solve this error by defining the inverse side of this association,  either with annotations specific to your integration (@OneToMany(mappedBy = ...) in Hibernate ORM)  or with the Hibernate Search @AssociationInverseSide annotation. Alternatively, if you do not need to reindex 'com.bubalex.hibara.UserRoleEntity' when 'com.bubalex.hibara.UserEntity' is modified, you can disable automatic reindexing with @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW).
            path '.userRoles<collection>.user<no value extractors>.phoneNumber<no value extractors>': 
                failures: 
                  - HSEARCH700020: Unable to find the inverse side of the association on type 'com.bubalex.hibara.UserRoleEntity' at path '.user<no value extractors>'. Hibernate Search needs this information in order to reindex 'com.bubalex.hibara.UserRoleEntity' when 'com.bubalex.hibara.UserEntity' is modified. You can solve this error by defining the inverse side of this association,  either with annotations specific to your integration (@OneToMany(mappedBy = ...) in Hibernate ORM)  or with the Hibernate Search @AssociationInverseSide annotation. Alternatively, if you do not need to reindex 'com.bubalex.hibara.UserRoleEntity' when 'com.bubalex.hibara.UserEntity' is modified, you can disable automatic reindexing with @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW).
	at org.hibernate.search.engine.reporting.spi.RootFailureCollector.checkNoFailure(RootFailureCollector.java:53) ~[hibernate-search-engine-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.engine.common.impl.SearchIntegrationBuilder.prepareBuild(SearchIntegrationBuilder.java:191) ~[hibernate-search-engine-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateSearchPreIntegrationService$NotBooted.doBootFirstPhase(HibernateSearchPreIntegrationService.java:258) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl.bootNow(HibernateOrmIntegrationBooterImpl.java:177) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2179) ~[na:na]
	at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:41) ~[hibernate-search-mapper-orm-orm6-6.2.0.Beta1.jar:6.2.0.Beta1]
	at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:292) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:431) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1455) ~[hibernate-core-6.2.5.Final.jar:6.2.5.Final]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:75) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.10.jar:6.0.10]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.10.jar:6.0.10]


This is a valid error since UserEntity doesn’t have an inverse side of user roles. The error message gives you suggestions on how to address this. As it suggests, you can add inverse side mappings, alternatively, here’s the section in the docs going into details on limiting reindexing if you decide to go that route - Hibernate Search 6.2.0.Final: Reference Documentation