• Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required


    错误提示:

    Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
    at org.springframework.util.Assert.notNull(Assert.java:193) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.mybatis.spring.support.SqlSessionDaoSupport.checkDaoConfig(SqlSessionDaoSupport.java:74) ~[mybatis-spring-1.3.2.jar:1.3.2]
    at org.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:73) ~[mybatis-spring-1.3.2.jar:1.3.2]
    at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44) ~[spring-tx-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1765) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1702) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
    ... 34 common frames omitted

    原因: 缺少druid-spring-boot-starter。【springboot2 应该是默认集成了druid】

    解决方案:

    在pom.xml文件加入

    <dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>druid-spring-boot-starter</artifactId>
    <version>1.1.9</version>
    </dependency>

  • 相关阅读:
    StarUML 破解方法
    String、StringBuilder、StringBuffer对比
    ThreadLocal源码
    编程思想——访问权限控制
    设计模式——调停者模式
    Abp.vNext 权限备注
    Abp 中 模块 加载及类型自动注入 源码学习笔记
    使用 ZipArchive 生成Zip文件备注
    ORACLE 连接SQLSERVER 数据库备忘
    FastReport 自定义数据集
  • 原文地址:https://www.cnblogs.com/yuwentims/p/9202216.html
Copyright © 2020-2023  润新知