idea错误界面显示多处报错
Could not find bean with name 'redisUtil'
为找不到名字为上述的bean,经过一番查找找出原因,是jar包冲突
具体报错信息
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redisUtil' defined in file [C:\DATA\Codeing\SpringBoot\springboot01\target\classes\com\hqyj\springboot01\untils\RedisUtil.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redisTemplate' defined in class path resource [com/hqyj/springboot01/config/RedisConfig.class]: Unsatisfied dependency expressed through method 'redisTemplate' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisConnectionFactory' defined in class path resource [org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: COPY
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>2.7.2</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>3.9.0</version>
</dependency>
将这两个jar包删除即可解决问题