启动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可以接收字符串,改成如下即可
正常运行