首页 > 数据库技术 > 详细

Cannot convert value of type 'java.lang.String' to required type 'java.sql.Driver' for property 'driver'

时间:2020-08-19 09:56:30      阅读:121      评论:0      收藏:0      [点我收藏+]

启动tomcat项目时报错,项目时ssm框架

tomcat报错:

Artifact spring-redis:war exploded: Error during artifact deployment. See server log for details.

查看tomcat日志:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘dataSource‘ defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type ‘java.lang.String‘ to required type ‘java.sql.Driver‘ for property ‘driver‘; nested exception is java.lang.IllegalStateException: Cannot convert value of type ‘java.lang.String‘ to required type ‘java.sql.Driver‘ for property ‘driver‘: no matching editors or conversion strategy found

技术分享图片

翻译:

不能将string类型转换为driver类型,

解决办法:

配置文件中只有数据源配置用到了driver

技术分享图片

driver接收的是一个类,driverclassname可以接收字符串,改成如下即可

技术分享图片

正常运行

Cannot convert value of type 'java.lang.String' to required type 'java.sql.Driver' for property 'driver'

原文:https://www.cnblogs.com/xhdt/p/13527467.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!