Closed ilgrosso closed 1 year ago
Thanks for the report but Spring Native is no longer maintained. Please update that sample project to the latest Spring Boot 3 milestone and create an issue in Spring Framework if that still occurs. To get started check https://spring.io/blog/2022/09/26/native-support-in-spring-boot-3-0-0-m5
Hi @ilgrosso
Have you been able to solve this after using spring boot 3.x.x? I am currently having a similar issue.
The SomeEntity (annotated by https://github.com/entity) is used in SomeRepository (annotated by @repository). Also in my case, the project is able to start in SB 3.0.0 without the native support.
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'rabbitMQConsumer': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'someService': Unsatisfied depend
ency expressed through constructor parameter 0: Error creating bean with name 'someRepository': Not a managed type: class com.someCompany.model.SomeEntity
at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:351)
at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:271)
at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:206)
at com.someCompany.SomeApplication.main(SomeApplication.java:26)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'someService': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'someRepository': Not
a managed type: class com.someCompany.model.SomeEntity
at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:351)
at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:271)
at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:206)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'someRepository': Not a managed type: class com.someCompany.model.SomeEntity
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1751)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)
Caused by: java.lang.IllegalArgumentException: Not a managed type: class com.someCompany.model.SomeEntity
at org.hibernate.metamodel.model.domain.internal.JpaMetamodelImpl.managedType(JpaMetamodelImpl.java:181)
at org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.managedType(MappingMetamodelImpl.java:496)
at org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.managedType(MappingMetamodelImpl.java:99)
at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation.<init>(JpaMetamodelEntityInformation.java:77)
Same situation as #1581 but here with Maven and Java.
The reproducer is at https://github.com/ilgrosso/notturno
Environment:
works fine while native image generated by
and started via
is crashing with message