Exception when integrating SM framework

When I was doing SM framework integration today, the following error occurred:
September 04, 2022 5:58:21 pm org.springframework.context.support.AbstractApplicationContext refresh
警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userServiceImpl’: Unsatisfied dependency expressed through field ‘userMapper’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userMapper’ defined in file [E:\IDEAdata\spring_SM\target\classes\com\zzuli\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property ‘sqlSessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.mybatis.spring.SqlSessionFactoryBean#0’ defined in class path resource [applicationcontext_mapper.xml]: Cannot resolve reference to bean ‘dataSource’ while setting bean property ‘dataSource’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘dataSource’ defined in class path resource [applicationcontext_mapper.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…
Finally, it turned out to be in application_mapper. The data source configuration error in xml
insert image description here
must be noted here. The name of the first property tag is driverClassName. Do not configure it as driver, otherwise you will have the same error as me. The above is my error handling, just for your study and reference .

Guess you like

Origin blog.csdn.net/Kirihara_Yukiho/article/details/126692399