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 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
版权声明:本文标题:springboot使用jpa启动报错consider defining a bean of type '*.*.**Repository' in your configurati 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686551741a80958.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论