
springboot使用jpa启动报错consider defining a bean of type '*.*.**Repository' in your configurati
springboot使用jpa数据访问启动报错consider defining a bean of type ‘..**Repository’ in your configuration.
maven工程: SpringBoot1.5 +Web+JPA+MYSQL+JDBC
报错信
*************************** APPLICATION FAILED TO START *************************** Description: Field userRepository in com.lvshuy.addresslist.controller.UserController required a bean of type 'com.lvshuy.addresslist.repository.UserRepository' that could not be found. Action: Consider defining a bean of type 'com.lvshuy.addresslist.repository.UserRepository' in your configuration.解决办法: 在启动类加上@ComponentScan注解。
@ComponentScan(basePackages = {"com.lvshuy.addresslist.repository"}) public class AddresslistApplication { public static void main(String[] args) { SpringApplication.run(AddresslistApplication.class, args); } }相关问题: 【SpringBoot 启动报错Cannot determine embedded database driver class for database type NONE】
👁️ 阅读量:0
© 版权声明:本文《springboot使用jpa启动报错consider defining a bean of type '*.*.**Repository' in your configurati》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686551959a289777.html。