-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed as not planned
Closed as not planned
Copy link
Labels
for: external-projectFor an external project and not something we can fixFor an external project and not something we can fix
Description
I have a Spring Boot 4 project with multiple @EnableJpaRepositories configurations.
When I run the application without AOT it's working fine.
But if I package it with AOT and execute it with AOT enabled I get this exception:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'secondRepository': Not a managed type: class org.example.second.SecondEntity
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1817) ~[spring-beans-7.0.1.jar:7.0.1]
...
Caused by: java.lang.IllegalArgumentException: Not a managed type: class org.example.second.SecondEntity
at org.hibernate.metamodel.model.domain.internal.JpaMetamodelImpl.managedType(JpaMetamodelImpl.java:247) ~[hibernate-core-7.1.8.Final.jar:7.1.8.Final]
at org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.managedType(MappingMetamodelImpl.java:413) ~[hibernate-core-7.1.8.Final.jar:7.1.8.Final]
at org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.managedType(MappingMetamodelImpl.java:88) ~[hibernate-core-7.1.8.Final.jar:7.1.8.Final]
Demo Project:
If you just change the Spring Boot Version in this project to 3.5.8 it's working, but not with 4.0.0.
https://github.com/hendrik-frahmann-nmc/spring-boot-4-multi-jpa-demo
Metadata
Metadata
Assignees
Labels
for: external-projectFor an external project and not something we can fixFor an external project and not something we can fix