Spring boot using Redis, error, there are redistemplate and stringredistemplate two beans?

Source: Internet
Author: User

  Error starting ApplicationContext. To display the Auto-configuration report re-run your application with ' debug ' enabled.2017-05-13 20:11:30.651 ERROR 1869- --[main] O.s.b.d.loggingfailureanalysisreporter: ***************************application FAILED to START**** Description:parameter 0 of the method Setredis in Cn.andhub.authorization.manager.impl.RedisTokenManager required a single beans, but 2 were found:-Redistemplate:defin Ed by method ' Redistemplate ' in class path resource [org/springframework/boot/autoconfigure/data/redis/ Redisautoconfiguration$redisconfiguration.class]-stringredistemplate:defined by method ' Stringredistemplate ' in CLA SS Path Resource [org/springframework/boot/autoconfigure/data/redis/redisautoconfiguration$ Redisconfiguration.class]action:consider marking one of the beans as @Primary, updating the consumer to accept multiple be ans, or using @Qualifier to identify the bean, which should be consumed  

 

Workaround:

Spring-boot-starter-parent the latest version should be 2.0.0, will report this error, change as follows:
<parent>

    <groupId>org.springframework.boot</groupId>    <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.6.RELEASE</version> //降低parent版本 <relativePath/> <!-- lookup parent from repository --></parent>

Spring boot using Redis, error, there are redistemplate and stringredistemplate two beans?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.