*************************** APPLICATION FAILED TO START *************************** Description: Field usuarioDao in es.uc3m.tiw.Controladores.Controlador required a bean named 'entityManagerFactory' that could not be found. Action: Consider defining a bean named 'entityManagerFactory' in your configuration.
因為是之前的項目, 現在報錯, 網上說的刪除maven倉庫hibernate下的包, 試了也沒用; 后來想是不是springboot版本問題,
於是在pom.xml文件中將
springboot的版本從
<version>2.1.1.RELEASE</version>
改成
<version>2.1.4.RELEASE</version>
項目即可運行...
另外一個錯誤
*************************** APPLICATION FAILED TO START *************************** Description: Field roleRepository in top.wujinxing.ch15jpa.controller.RoleController required a bean of type 'top.wujinxing.ch15jpa.dao.RoleRepository' that could not be found. The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Autowired(required=true) Action: Consider defining a bean of type 'top.wujinxing.ch15jpa.dao.RoleRepository' in your configuration. Process finished with exit code 1
需要在項目入口添加
@ComponentScan(basePackages = "top.wujinxing.ch15jpa.dao")