项目引发这个问题:

Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required

  	<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.3</version>
</dependency>

事故原因:之前还是好好地运行,结果加入了redis-seesion就变成这样了

上网百度:一大片的都是一下方案:

1.mybatis-plus版本问题.

2.加入druid的依赖

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

3.去除数据源自动注入的

@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})

我一想,这个我项目本身就是用了druid依赖,而且这个版本的我之前运行过没问题呀

一定是使用redis-session这个依赖搞出的问题》

查看项目这个依赖,感觉没问题呀。。。

 <!--session共享替换为redis-->
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>

一想Springboot集成redis-session不可能是现在才有的,很早之前就有了,不可能没有启动器呀。于是加上一个这个启动器试一试

 <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>

没想到OK了

+++++++

忽然又发现一个问题,多环境下的Springboot的配置不起作用啊》》》

我这是Springboot2.5+;

spring:
profiles:
active: prod

这个找不到application-prod.yml;明明有啊

这样写

  config:
activate:
on-profile: "dev"

SpringBoot2.5.1+Mybatis-Plus3.4.3:(Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required)的更多相关文章

  1. SpringBoot+MyBatis整合报错Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

    项目启动的时候报这个错误,这个问题我百度了一天,果然不出意外的还是没能解决,其中有一篇文章相对来说还是有点用的:https://blog.csdn.net/qq8693/article/details ...

  2. Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required [ IDEA mybatis项目报错 ]

    今天笔者用Springboot框架整合Mybatis做一个小小的项目: 代码写完,在运行项目时,IDEA给我报了3处错误: org.springframework.beans.factory.Unsa ...

  3. Springboot 2.0.4 整合Mybatis出现异常Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

    在使用Springboot 2.0.4 整合Mybatis的时候出现异常Property 'sqlSessionFactory' or 'sqlSessionTemplate' are require ...

  4. spring boot 2.0.0 + mybatis 报:Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

    spring boot 2.0.0 + mybatis 报:Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required 无法启动 ...

  5. springboot整合mybatis的时候报错Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

    今天闲来无事,学习springboot整合mybatis,在bilibili看视频学的,视频中在dao层的interface上面加上org.apache.ibatis.annotations.Mapp ...

  6. springmvc与mybatis整合时 java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required 异常

    今天在整合springmvc与mybatis时,启动服务器遇到这样一个问题, by: java.lang.IllegalArgumentException: Property 'sqlSessionF ...

  7. MyBatis与Spring MVC结合时,使用DAO注入出现:Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

    错误源自使用了这个例子:http://www.yihaomen.com/article/java/336.htm,如果运行时会出现如下错误: Invocation of init method fai ...

  8. Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'e ...

  9. 使用 Jenkins 打包成功后 运行 出现 Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

    linux 运行时 错误日志 Error starting ApplicationContext. To display the conditions report re-run your appli ...

  10. Spring整合Mybatis解决 Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

    在Spring4和Mybatis3整合的时候,dao层注入'sqlSessionFactory'或'sqlSessionTemplate'会报错解决办法如下: package com.alibaba. ...

随机推荐

  1. 在Winform开发中,我们使用的几种下拉列表展示字典数据的方式

    在Winform开发中中,我们为了方便客户选择,往往使用系统的字典数据选择,毕竟选择总比输入来的快捷.统一,一般我们都会简单封装一下,以便方便对控件的字典值进行展示处理,本篇随笔介绍DevExpres ...

  2. x-pack设置完毕后,es-head无法登陆的问题, 登录需要账号密码的问题

    在elasticsearch.yml中添加如下三行配置 http.cors.enabled: true http.cors.allow-origin: "*" http.cors. ...

  3. 等保审核 --- MySQL密码复杂度--和连接错误超时等

    系统版本: Centos 7 MySQL版本: 5.7.19 架构: 主从架构 审计插件: validate_password.so(数据库自带5.6后版本都拥有此插件) 操作过程: 1). 安装va ...

  4. Jetbrains家的软件都可用的激活码-pycharm

    网址:http://vrg123.com/ 步骤: 1,关注下方的公众号 2,点击菜单中的"激活密钥" 3,点击进入,获得网站密钥 4,在网站上输入网站密钥,点击获取,即可获取激活 ...

  5. aws-cli命令-ec2实例相关的操作

    aws上可以使用aws-cli的方式管理实例,记录一些常用的操作 1.启动.关闭.终止实例(目前笔者发现只能通过指定实例ID进行管理) # 启动/关闭/重启 指定的实例 aws ec2 start-i ...

  6. gradle项目对比maven项目的目录架构以及对gradle wrapper的理解

    转载请注明出处: 1.使用 idea 搭建 gradle项目 注意 type 选择 gradle 以及 language 选择 grooy                       搭建后的项目架构 ...

  7. Invalid bound statement (not found)出现原因和解决方法

    Invalid bound statement (not found)出现原因和解决方法 前言: 想必各位小伙伴在码路上经常会碰到奇奇怪怪的事情,比如出现Invalid bound statement ...

  8. Bootstrap中的dropdown、下拉选择框、dropdown-toggle

    注意:如果您想要单独引用该插件的功能,那么您需要引用 dropdown.js.可以引用 bootstrap.js 或压缩版的 bootstrap.min.js. <!DOCTYPE html&g ...

  9. 动态搜索图书:可以按书名、作者、出版社以及价格范围进行搜索。(在IDEA中mybatis)

    中午找了好久.好多人写的都驴头不对马嘴.自己实现后.才发现是真的不麻烦.也不知道人家咋想的.写的死麻烦还没用.老是搜出sql语句写死的.我要的是动态滴.自己写出后.总结了一下 1.按照书名.作者.出版 ...

  10. MVVM视图模型