Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

Posted 长久悠悠

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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>












以上是关于Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required的主要内容,如果未能解决你的问题,请参考以下文章

报错TypeError: Cannot read property 'range' of null

Ibatis中的一个“There is no READABLE property named 'uId' in class 'userinfoPo”错误

vue3踩过的坑 - Cannot read property '$router' of undefined

Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

struts2 的标签<s:property value=''/> escape 属性

一种Uncaught TypeError: Cannot read property 'property' of undefined错误的解决办法