1. redis中maven中报错,原配置如下:

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

  查询后发现,SpringBoot在1.4.7及之前版本是使用该目录,后来对文件目录做了更新,应该根据需要使用下面形式

1.1 仍使用1.4.7及以前版本

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-redis</artifactId>
            <version>1.4.7.RELEASE</version>
</dependency>

 

1.2 使用较高版本

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

 

 

2. 配置使用到了缓存

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

  

  使用时,报错如下:

No Spring Session store is configured: set the 'spring.session.store-type' property

  在网上搜索之后,我们发现session store type使用来存放session的存储方式,目前Spring boot中只支持redis方式。 由于本应用暂无需将session放入redis的需求,故这里就可以将session store type设置为none.

  配置如下:

spring.session.store-type=none

  重启应用即可。

 

posted on 2018-11-30 17:24  豫华商  阅读(366)  评论(0编辑  收藏  举报