• 整合SM框架时出现的异常


    今天在做SM框架整合的时候,出现了如下的错误:
    9月 04, 2022 5:58:21 下午 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…
    最后发现原来是在application_mapper。xml中的数据源配置出错
    在这里插入图片描述
    这里一定要注意,第一个property标签的name时driverClassName,不要配置成driver,否则你会出现和我一样的错误,以上是我的错误处理,仅供大家学习和参考。

  • 相关阅读:
    数据结构入门——排序(代码实现)(下)
    论文阅读 DynGEM: Deep Embedding Method for Dynamic Graphs
    HTML静态网页作业——电影介绍-你的名字 5页 无js 带音乐
    可编程 USB 转串口适配器开发板的详细接口与功能
    Spring AOP使用与原理
    chromium的下载和编译(流程详解)
    生产环境中常用Linux命令
    Antd中Table列表行默认包含修改及删除功能的封装
    30天啃透这份Framework 源码手册直接面进大厂
    Tensor 的广播机制
  • 原文地址:https://blog.csdn.net/Kirihara_Yukiho/article/details/126692399