✅ 操作成功!

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

发布时间:2023-06-12 作者:admin 来源:文学

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】

👁️ 阅读量:0