首页 / JAVA / Failed to bind properties under ‘spring.datasource.type‘ to java.lang.Class<javax.sql.DataSource>
Failed to bind properties under ‘spring.datasource.type‘ to java.lang.Class<javax.sql.DataSource>
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Failed to bind properties under ‘spring.datasource.type‘ to java.lang.Class<javax.sql.DataSource>,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2731字,纯文字阅读大概需要4分钟。
内容图文
Description:
Failed to bind properties under 'spring.datasource.type' to java.lang.Class<javax.sql.DataSource>:
Property: spring.datasource.type
Value: com.machange.v2.c3p0.ComboPooledDataSource
Origin: class path resource [application.yml] - 9:11
Reason: No converter found capable of converting from type [java.lang.String] to type [java.lang.Class<javax.sql.DataSource>]
Action:
Update your application's configuration
Process finished with exit code 1
错误提示,yml文件9到11行。观察数据源配置
#数据源配置
spring:
datasource:
type: com.machange.v2.c3p0.ComboPooledDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/springboot?useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC
type输入错误,修改type,重新运行。
type: com.mchange.v2.c3p0.ComboPooledDataSource
成功。
2021-02-02 09:18:18.424 INFO 12192 --- [ main] com.shsxt.springboot.Starter : Starting Starter using Java 1.8.0_271 on PC-20200119CAVL with PID 12192 (D:\java_project\SpringBoot05\target\classes started by Administrator in D:\java_project\SpringBoot05)
2021-02-02 09:18:18.428 INFO 12192 --- [ main] com.shsxt.springboot.Starter : No active profile set, falling back to default profiles: default
2021-02-02 09:18:21.463 INFO 12192 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2021-02-02 09:18:21.476 INFO 12192 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-02-02 09:18:21.477 INFO 12192 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.41]
2021-02-02 09:18:21.670 INFO 12192 --- [ main] o.a.c.c.C.[.[.[/springboot_mybatis] : Initializing Spring embedded WebApplicationContext
2021-02-02 09:18:21.670 INFO 12192 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3105 ms
2021-02-02 09:18:21.919 INFO 12192 --- [ main] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource
2021-02-02 09:18:22.470 INFO 12192 --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited
2021-02-02 09:18:23.032 INFO 12192 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-02-02 09:18:23.421 INFO 12192 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '/springboot_mybatis'
2021-02-02 09:18:23.437 INFO 12192 --- [ main] com.shsxt.springboot.Starter : Started Starter in 5.932 seconds (JVM running for 6.932)
内容总结
以上是互联网集市为您收集整理的Failed to bind properties under ‘spring.datasource.type‘ to java.lang.Class<javax.sql.DataSource>全部内容,希望文章能够帮你解决Failed to bind properties under ‘spring.datasource.type‘ to java.lang.Class<javax.sql.DataSource>所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。