前言
公司找出来一个老古董项目,动手修改的时候的两个问题
问题一
无法访问org.apache.http.annotation.ThreadSafe
找不到org.apache.http.annotation.ThreadSafe的类文件
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.1</version>
</dependency>
错误原因httpclient版本太低,升级版本后问题解决
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
问题二
required a bean of type ‘org.springframework.data.redis.core.RedisTemplate’ that could not be found.
错误原因注入RedisTemplate的时候加入了泛型
正确方式:
@Autowired
private RedisTemplate redisTemplate;