SpringBoot使用JdbcTemplate 项目启动报错:

报错详情:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-03-13 15:31:51.932 ERROR 31060 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Field jdbcTemplate in com.lmy.demo.service.UserService required a bean of type 'org.springframework.jdbc.core.JdbcTemplate' that could not be found.

The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)

Action:

Consider defining a bean of type 'org.springframework.jdbc.core.JdbcTemplate' in your configuration.


慕莱坞森
浏览 6312回答 4
4回答

慕斯王

保存,重启项目,有没有,然后看spring配置文件中有没有配dataSource的用户名秘密什么的

天涯尽头无女友

定义了吗,如果定义了,是不是没有定义扫描那个包

拉莫斯之舞

包,注解以及配置文件看一下jdbc链接池的配置是否正确
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java