1、报错信息如下:
***************************
APPLICATION FAILED TO START
***************************
Description:
Field redisTemplate in com.xialj.demoend.service.impl.UploadServiceImpl required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'org.springframework.data.redis.core.RedisTemplate' in your configuration.
2、解决方案:
将 :
@Autowired
private RedisTemplate<String, Object> redisTemplate;
改为:
@Resource
private RedisTemplate<String, Object> redisTemplate;