【发布时间】:2020-10-24 02:02:30
【问题描述】:
点击以下链接
https://guides.micronaut.io/micronaut-data-access-jpa-hibernate/guide/index.html
我试图连接postgresql,
运行测试时,所有测试都通过但尝试调用端点http://localhost:8080/genres/1
它给出了以下错误:
{
"message": "Internal Server Error: Failed to inject value for parameter [entityManager] of class: example.micronaut.$GenreRepositoryImplDefinition$Intercepted\n\nMessage: No bean of type [javax.persistence.EntityManager] exists. Make sure the bean is not disabled by bean requirements (enable trace logging for 'io.micronaut.context.condition' to check)
and if the bean is enabled then ensure the class is declared a bean and annotation processing is enabled (for Java and Kotlin the 'micronaut-inject-java' dependency should be configured as an annotation processor).\nPath Taken:
new $GenreControllerDefinition$Intercepted([GenreRepository genreRepository],BeanContext beanContext,Qualifier qualifier,Interceptor[] interceptors) -->
new $GenreRepositoryImplDefinition$Intercepted([EntityManager entityManager],ApplicationConfiguration applicationConfiguration,BeanContext beanContext,Qualifier qualifier,Interceptor[] interceptors)"
}
【问题讨论】:
标签: java postgresql gradle micronaut