admin管理员组

文章数量:1794759

springboot使用jpa启动报错consider defining a bean of type '*.*.**Repository' in your configurati

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】

本文标签: 报错definingbeanjpaSpringBoot