spring-attic / spring-native

Spring Native is now superseded by Spring Boot 3 official native support
https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html
Apache License 2.0
2.74k stars 356 forks source link

Spring project using Hibernate Search #1645

Closed jeanlazarou closed 2 years ago

jeanlazarou commented 2 years ago

Did anyone try to compile a project using Hibernate Search?

I tried to compile a spring-boot app where we are using Hibernate Search, full text search on name fields of entities like users.

(annotations like @Field, @Indexed, @Analyzer and APIs org.hibernate.search.query.dsl.QueryBuilder, org.hibernate.search.jpa.FullTextQuery)

Compilation went fine but the app does not boot-up.

I created an empty project:

It clearly appears that there is some conflict between the 2 libraries, but I have no idea how to tackle the issue.

Running the compiled JAR succeeds:

java -jar target/demo-0.0.1-SNAPSHOT-exec.jar

I use the following Java version:

java -version
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment GraalVM CE 22.1.0 (build 17.0.3+7-jvmci-22.1-b06)
OpenJDK 64-Bit Server VM GraalVM CE 22.1.0 (build 17.0.3+7-jvmci-22.1-b06, mixed mode, sharing)

Here is the command I use to compile the app:

./mvnw package -Pnative -DskipTests

The only Java code is the main file:

package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

}

Here is the pom file (if you un-comment the 2 dependencies you get the version that fails):

<?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>2.7.0</version>
    <relativePath/>
    <!-- lookup parent from repository -->
  </parent>
  <groupId>com.example</groupId>
  <artifactId>demo</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>demo</name>
  <description>Demo project for Spring Boot</description>
  <properties>
    <java.version>17</java.version>
    <repackage.classifier/>
    <spring-native.version>0.12.0</spring-native.version>
  </properties>
  <dependencies>
    <!--
        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
          <groupId>org.postgresql</groupId>
          <artifactId>postgresql</artifactId>
        </dependency>
        -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.experimental</groupId>
      <artifactId>spring-native</artifactId>
      <version>${spring-native.version}</version>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-search-orm</artifactId>
      <version>5.11.10.Final</version>
      <exclusions>
        <exclusion>
          <groupId>org.jboss.logging</groupId>
          <artifactId>jboss-logging</artifactId>
        </exclusion>
      </exclusions>
    </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>
          <classifier>${repackage.classifier}</classifier>
          <image>
            <builder>paketobuildpacks/builder:tiny</builder>
            <env>
              <BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
            </env>
          </image>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.springframework.experimental</groupId>
        <artifactId>spring-aot-maven-plugin</artifactId>
        <version>${spring-native.version}</version>
        <executions>
          <execution>
            <id>test-generate</id>
            <goals>
              <goal>test-generate</goal>
            </goals>
          </execution>
          <execution>
            <id>generate</id>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.hibernate.orm.tooling</groupId>
        <artifactId>hibernate-enhance-maven-plugin</artifactId>
        <version>${hibernate.version}</version>
        <executions>
          <execution>
            <id>enhance</id>
            <goals>
              <goal>enhance</goal>
            </goals>
            <configuration>
              <failOnError>true</failOnError>
              <enableLazyInitialization>true</enableLazyInitialization>
              <enableDirtyTracking>true</enableDirtyTracking>
              <enableAssociationManagement>true</enableAssociationManagement>
              <enableExtendedEnhancement>false</enableExtendedEnhancement>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <repositories>
    <repository>
      <id>spring-releases</id>
      <name>Spring Releases</name>
      <url>https://repo.spring.io/release</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>spring-releases</id>
      <name>Spring Releases</name>
      <url>https://repo.spring.io/release</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

  <profiles>
    <profile>
      <id>native</id>
      <properties>
        <repackage.classifier>exec</repackage.classifier>
        <native-buildtools.version>0.9.11</native-buildtools.version>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.junit.platform</groupId>
          <artifactId>junit-platform-launcher</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.graalvm.buildtools</groupId>
            <artifactId>native-maven-plugin</artifactId>
            <version>${native-buildtools.version}</version>
            <extensions>true</extensions>
            <executions>
              <execution>
                <id>test-native</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
              </execution>
              <execution>
                <id>build-native</id>
                <phase>package</phase>
                <goals>
                  <goal>build</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>

The application.properties file contains the database parameters, something like:

spring.datasource.url=jdbc:postgresql://localhost:5432/my-db
spring.datasource.username=postgres
spring.datasource.password=***********

And the console output (stack trace) is:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory': Invocation of init method failed; nested exception is org.hibernate.AssertionFailure: Error calling ServiceLoader.Provider.type()
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[demo:5.3.20]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[demo:5.3.20]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[demo:5.3.20]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[demo:5.3.20]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[demo:5.3.20]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[demo:5.3.20]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[demo:5.3.20]
        at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[demo:5.3.20]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[demo:5.3.20]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[demo:5.3.20]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[na:na]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) ~[demo:0.0.1-SNAPSHOT]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[demo:0.0.1-SNAPSHOT]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[demo:0.0.1-SNAPSHOT]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[demo:0.0.1-SNAPSHOT]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[demo:0.0.1-SNAPSHOT]
        at com.example.demo.DemoApplication.main(DemoApplication.java:10) ~[demo:0.0.1-SNAPSHOT]
Caused by: org.hibernate.AssertionFailure: Error calling ServiceLoader.Provider.type()
        at org.hibernate.boot.registry.classloading.internal.AggregatedServiceLoader$ClassPathAndModulePathAggregatedServiceLoader.collectServiceIfNotDuplicate(AggregatedServiceLoader.java:272) ~[na:na]
        at org.hibernate.boot.registry.classloading.internal.AggregatedServiceLoader$ClassPathAndModulePathAggregatedServiceLoader.loadAll(AggregatedServiceLoader.java:201) ~[na:na]
        at org.hibernate.boot.registry.classloading.internal.AggregatedServiceLoader$ClassPathAndModulePathAggregatedServiceLoader.getAll(AggregatedServiceLoader.java:187) ~[na:na]
        at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:251) ~[na:na]
        at org.hibernate.integrator.internal.IntegratorServiceImpl.<init>(IntegratorServiceImpl.java:40) ~[na:na]
        at org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:224) ~[na:na]
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildBootstrapServiceRegistry(EntityManagerFactoryBuilderImpl.java:479) ~[na:na]
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:222) ~[na:na]
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:182) ~[na:na]
        at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:52) ~[na:na]
        at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[demo:5.3.20]
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[demo:5.3.20]
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[demo:5.3.20]
        at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[demo:5.3.20]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[demo:5.3.20]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[demo:5.3.20]
        ... 16 common frames omitted
Caused by: java.lang.NullPointerException: null
        at org.hibernate.boot.registry.classloading.internal.AggregatedServiceLoader$ClassPathAndModulePathAggregatedServiceLoader.collectServiceIfNotDuplicate(AggregatedServiceLoader.java:269) ~[na:na]
        ... 31 common frames omitted
sdeleuze commented 2 years ago

Hi, not sure if we tried, could you please provide a reproducer project with the elements described above?

Map commented 2 years ago

I can reproduce the 100% exact same console output by only adding `

org.hibernate
        <artifactId>hibernate-envers</artifactId>
    </dependency>

` to a minimal maven project including -spring-boot-starter -spring-boot-starter-data-jpa -spring-native -mysql-connector-java

I also compiled with mvn spring-boot:build-image -DSkipTests

Similar bug was reported here and i gave up debugging until hibernate entity listening is fixed in future versions

jeanlazarou commented 2 years ago

demo.zip

Here is a project, as I described it does nothing, you only need to compile then start the compiled app.

sdeleuze commented 2 years ago

I can indeed reproduce the error with both GraalVM 22.0 and 22.1 but that sounds like an Hibernate level error so not sure what we can do at Spring Native level.

jeanlazarou commented 2 years ago

I see. I guess I should close the issue here.

miguelangelgalindez commented 1 year ago

I've got the very same issue trying to run the native image. I'm using Spring Boot 3.0.0 and still having trouble with that. Here are my relevant dependencies:

And this is the output showing the error: Invalid logger interface org.hibernate.internal.log.IncubationLogger (implementation not found in jdk.internal.loader.ClassLoaders$AppClassLoader@77f03bb1). Thanks in advance for your time.

docker-document-1     | 
docker-document-1     |   .   ____          _            __ _ _
docker-document-1     |  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
docker-document-1     | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
docker-document-1     |  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
docker-document-1     |   '  |____| .__|_| |_|_| |_\__, | / / / /
docker-document-1     |  =========|_|==============|___/=/_/_/_/
docker-document-1     |  :: Spring Boot ::                (v3.0.0)
docker-document-1     | 
docker-document-1     | 2022-12-13T22:57:28.432Z  INFO 1 --- [           main] c.example.service.document.Application   : Starting AOT-processed Application using Java 17.0.5 with PID 1 (/workspace/com.example.service.document.Application started by cnb in /workspace)
docker-document-1     | 2022-12-13T22:57:28.432Z  INFO 1 --- [           main] c.example.service.document.Application   : No active profile set, falling back to 1 default profile: "default"
docker-document-1     | 2022-12-13T22:57:28.459Z  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8082 (http)
docker-document-1     | 2022-12-13T22:57:28.460Z  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
docker-document-1     | 2022-12-13T22:57:28.460Z  INFO 1 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.1]
docker-document-1     | 2022-12-13T22:57:28.464Z  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
docker-document-1     | 2022-12-13T22:57:28.464Z  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 32 ms
docker-document-1     | 2022-12-13T22:57:28.485Z  INFO 1 --- [           main] liquibase.integration                    : Liquibase did not run because 'shouldRun' property was set to false on liquibase Liquibase Spring bean.
docker-document-1     | 2022-12-13T22:57:28.491Z  INFO 1 --- [         task-1] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
docker-document-1     | 2022-12-13T22:57:28.492Z  INFO 1 --- [         task-1] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 6.1.5.Final
docker-document-1     | 2022-12-13T22:57:28.496Z  INFO 1 --- [         task-1] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
docker-document-1     | 2022-12-13T22:57:28.510Z  INFO 1 --- [         task-1] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@7e305d5c
docker-document-1     | 2022-12-13T22:57:28.510Z  INFO 1 --- [         task-1] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
docker-document-1     | 2022-12-13T22:57:28.514Z  INFO 1 --- [         task-1] SQL dialect                              : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
docker-document-1     | 2022-12-13T22:57:28.515Z  WARN 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentMapperImpl': Unsatisfied dependency expressed through field 'documentRepository': Error creating bean with name 'documentRepository': Cannot resolve reference to bean 'jpaMappingContext' while setting bean property 'mappingContext'
docker-document-1     | 2022-12-13T22:57:28.515Z  INFO 1 --- [           main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
docker-document-1     | 2022-12-13T22:57:28.515Z  WARN 1 --- [           main] o.s.b.f.support.DisposableBeanAdapter    : Invocation of destroy method failed on bean with name 'entityManagerFactory': java.lang.IllegalStateException: Failed to asynchronously initialize native EntityManagerFactory: java.lang.ExceptionInInitializerError
docker-document-1     | 2022-12-13T22:57:28.515Z  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
docker-document-1     | 2022-12-13T22:57:28.515Z  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
docker-document-1     | 2022-12-13T22:57:28.516Z  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
docker-document-1     | 2022-12-13T22:57:28.518Z ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed
docker-document-1     | 
docker-document-1     | org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentMapperImpl': Unsatisfied dependency expressed through field 'documentRepository': Error creating bean with name 'documentRepository': Cannot resolve reference to bean 'jpaMappingContext' while setting bean property 'mappingContext'
docker-document-1     |         at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:195) ~[na:na]
docker-document-1     |         at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveObject(AutowiredFieldValueResolver.java:154) ~[na:na]
docker-document-1     |         at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolve(AutowiredFieldValueResolver.java:143) ~[na:na]
docker-document-1     |         at com.example.service.document.mapper.DocumentMapperImpl__Autowiring.apply(DocumentMapperImpl__Autowiring.java:15) ~[na:na]
docker-document-1     |         at org.springframework.beans.factory.support.InstanceSupplier$1.get(InstanceSupplier.java:82) ~[na:na]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1225) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1210) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1157) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:961) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:915) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[com.example.service.document.Application:3.0.0]
docker-document-1     |         at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[com.example.service.document.Application:3.0.0]
docker-document-1     |         at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[com.example.service.document.Application:3.0.0]
docker-document-1     |         at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[com.example.service.document.Application:3.0.0]
docker-document-1     |         at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[com.example.service.document.Application:3.0.0]
docker-document-1     |         at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[com.example.service.document.Application:3.0.0]
docker-document-1     |         at com.example.service.document.Application.main(Application.java:10) ~[com.example.service.document.Application:na]
docker-document-1     | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentRepository': Cannot resolve reference to bean 'jpaMappingContext' while setting bean property 'mappingContext'
docker-document-1     |         at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:377) ~[na:na]
docker-document-1     |         at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:135) ~[na:na]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1663) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1412) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1405) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1325) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:189) ~[na:na]
docker-document-1     |         ... 23 common frames omitted
docker-document-1     | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappingContext': Failed to asynchronously initialize native EntityManagerFactory: java.lang.ExceptionInInitializerError
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1751) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:365) ~[na:na]
docker-document-1     |         ... 36 common frames omitted
docker-document-1     | Caused by: java.lang.IllegalStateException: Failed to asynchronously initialize native EntityManagerFactory: java.lang.ExceptionInInitializerError
docker-document-1     |         at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.getNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:575) ~[com.example.service.document.Application:na]
docker-document-1     |         at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.invokeProxyMethod(AbstractEntityManagerFactoryBean.java:519) ~[com.example.service.document.Application:na]
docker-document-1     |         at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean$ManagedEntityManagerFactoryInvocationHandler.invoke(AbstractEntityManagerFactoryBean.java:733) ~[na:na]
docker-document-1     |         at jdk.proxy4/jdk.proxy4.$Proxy56.getMetamodel(Unknown Source) ~[na:na]
docker-document-1     |         at java.base@17.0.5/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
docker-document-1     |         at java.base@17.0.5/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[com.example.service.document.Application:na]
docker-document-1     |         at java.base@17.0.5/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845) ~[com.example.service.document.Application:na]
docker-document-1     |         at java.base@17.0.5/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[com.example.service.document.Application:na]
docker-document-1     |         at java.base@17.0.5/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[com.example.service.document.Application:na]
docker-document-1     |         at java.base@17.0.5/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[com.example.service.document.Application:na]
docker-document-1     |         at java.base@17.0.5/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[com.example.service.document.Application:na]
docker-document-1     |         at java.base@17.0.5/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[com.example.service.document.Application:na]
docker-document-1     |         at org.springframework.data.jpa.repository.config.JpaMetamodelMappingContextFactoryBean.getMetamodels(JpaMetamodelMappingContextFactoryBean.java:94) ~[com.example.service.document.Application:3.0.0]
docker-document-1     |         at org.springframework.data.jpa.repository.config.JpaMetamodelMappingContextFactoryBean.createInstance(JpaMetamodelMappingContextFactoryBean.java:68) ~[com.example.service.document.Application:3.0.0]
docker-document-1     |         at org.springframework.data.jpa.repository.config.JpaMetamodelMappingContextFactoryBean.createInstance(JpaMetamodelMappingContextFactoryBean.java:44) ~[com.example.service.document.Application:3.0.0]
docker-document-1     |         at org.springframework.beans.factory.config.AbstractFactoryBean.afterPropertiesSet(AbstractFactoryBean.java:142) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1797) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1747) ~[com.example.service.document.Application:6.0.2]
docker-document-1     |         ... 43 common frames omitted
docker-document-1     | Caused by: java.lang.ExceptionInInitializerError: null
docker-document-1     |         at org.hibernate.internal.util.config.ConfigurationHelper.getPreferredSqlTypeCodeForUuid(ConfigurationHelper.java:560) ~[na:na]
docker-document-1     |         at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:395) ~[na:na]
docker-document-1     |         at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:143) ~[na:na]
docker-document-1     |         at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1350) ~[com.example.service.document.Application:6.1.5.Final]
docker-document-1     |         at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1421) ~[com.example.service.document.Application:6.1.5.Final]
docker-document-1     |         at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:66) ~[na:na]
docker-document-1     |         at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[com.example.service.document.Application:na]
docker-document-1     |         at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[com.example.service.document.Application:na]
docker-document-1     |         at java.base@17.0.5/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[com.example.service.document.Application:na]
docker-document-1     |         at java.base@17.0.5/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[com.example.service.document.Application:na]
docker-document-1     |         at java.base@17.0.5/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
docker-document-1     |         at java.base@17.0.5/java.lang.Thread.run(Thread.java:833) ~[com.example.service.document.Application:na]
docker-document-1     |         at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775) ~[com.example.service.document.Application:na]
docker-document-1     |         at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203) ~[na:na]
docker-document-1     | Caused by: java.lang.IllegalArgumentException: Invalid logger interface org.hibernate.internal.log.IncubationLogger (implementation not found in jdk.internal.loader.ClassLoaders$AppClassLoader@77f03bb1)
docker-document-1     |         at org.jboss.logging.Logger.doGetMessageLogger(Logger.java:2564) ~[com.example.service.document.Application:3.5.0.Final]
docker-document-1     |         at org.jboss.logging.Logger.getMessageLogger(Logger.java:2530) ~[com.example.service.document.Application:3.5.0.Final]
docker-document-1     |         at org.jboss.logging.Logger.getMessageLogger(Logger.java:2516) ~[com.example.service.document.Application:3.5.0.Final]
docker-document-1     |         at org.hibernate.internal.log.IncubationLogger.<clinit>(IncubationLogger.java:25) ~[na:na]
docker-document-1     |         ... 14 common frames omitted
docker-document-1     | 
docker-document-1 exited with code 1