I have a problem when configuring micronauta with jpa, when I run the application and it should generate the sql for creating the tables, this error occurs.
I have this error
Message: Entities not found for JPA configuration: 'default' within packages [br.com.curso.model]. Check that you have correctly specified a package containing JPA entities within the "jpa.default.entity-scan.packages" property in your application configuration and that those entities are either compiled with Micronaut or a build time index produced with @Introspected(packages="foo.bar", includedAnnotations=Entity.class) declared on your Application class
Path Taken: SessionFactoryPerDataSourceFactory.buildHibernateSessionFactoryBuilder(SessionFactoryBuilder sessionFactoryBuilder) --> SessionFactoryPerDataSourceFactory.buildHibernateSessionFactoryBuilder([SessionFactoryBuilder sessionFactoryBuilder]) --> SessionFactoryPerDataSourceFactory.buildHibernateSessionFactoryBuilder([Metadata metadata],JpaConfiguration jpaConfiguration,String name)
io.micronaut.context.exceptions.BeanInstantiationException: Bean definition [org.hibernate.SessionFactory] could not be loaded: Error instantiating bean of type [org.hibernate.boot.SessionFactoryBuilder]
I have this application.properties that contains the path of the ‘Vehicle’ entity
micronaut.application.name=veiculo-service
datasources.default.driver-class-name=org.postgresql.Driver
datasources.default.url=jdbc:postgresql://127.0.0.1/dbveiculo
datasources.default.username=postgres
datasources.default.password=123456
datasources.default.scheme-generate=CREATE_DROP
datasources.default.dialect=POSTGRES
jpa.default.packages-to-scan=br.com.curso.model
jpa.default.properties.hibernate.hbm2ddl.auto=update
jpa.default.properties.hibernate.show_sql=true
jpa.default.properties.hibernate.format_sql=true
Even though the entity is on this path, the application complains about an error.
I have already checked the path and the entity ‘vehicle’ which already has the @Entity annotation. I hope the application runs normally and creates the tables