Failed to bind properties under ‘spring.datasource.type’ to java.lang.Class的解决方法
Failed to bind properties under ‘spring.datasource.type’ to java.lang.Class
问题详情如下:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-06-04 8:27:01.386 ERROR 11568 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'spring.datasource.type' to java.lang.Class<javax.sql.DataSource>:
Property: spring.datasource.type
Value: com.alibaba.druid.pool.DruidDataSource
Origin: class path resource [application.properties]:25:24
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
Disconnected from the target VM, address: '127.0.0.1:51477', transport: 'socket'
Process finished with exit code 0
解决方法:
配置文件pom.xml中添加依赖,问题解决
<!-- 引入Druid依赖,阿里巴巴所提供的数据源 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.13</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
</dependency>
还没有评论,来说两句吧...