题目描述
spring boot启动后报这个错误(数据库框架spring data jpa)
Description:
A component required a bean of type 'me.zhongmin.zero.dao.UserRepository' that could not be found.
Action:
Consider defining a bean of type 'me.zhongmin.zero.dao.UserRepository' in your configuration.
解决方案
把@SpringBootApplication注解中的exclude = DataSourceAutoConfiguration.class去掉,然后在application.properties配置文件中加上spring.datasourc的相关配置就可以了。