问题遇到的现象和发生背景
java.lang.IllegalStateException: 2 implementations of CachingConfigurer were found when only 1 was expected. Refactor the configuration such that CachingConfigurer is implemented only once or not at all.
at org.springframework.cache.annotation.AbstractCachingConfiguration.lambda$setConfigurers$0(AbstractCachingConfiguration.java:85) ~[spring-context-5.3.20.jar:5.3.20]
at org.springframework.util.function.SingletonSupplier.get(SingletonSupplier.java:97) ~[spring-core-5.3.20.jar:5.3.20]
at org.springframework.cache.annotation.AbstractCachingConfiguration$CachingConfigurerSupplier.lambda$adapt$0(AbstractCachingConfiguration.java:126) ~[spring-context-5.3.20.jar:5.3.20]
at org.springframework.util.function.SingletonSupplier.get(SingletonSupplier.java:97) ~[spring-core-5.3.20.jar:5.3.20]
at org.springframework.util.function.SupplierUtils.resolve(SupplierUtils.java:40) ~[spring-core-5.3.20.jar:5.3.20]
at org.springframework.cache.interceptor.CacheAspectSupport.getCacheResolver(CacheAspectSupport.java:184) ~[spring-context-5.3.20.jar:5.3.20]
at org.springframework.cache.interceptor.CacheAspectSupport.afterSingletonsInstantiated(CacheAspectSupport.java:216) ~[spring-context-5.3.20.jar:5.3.20]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:972) ~[spring-beans-5.3.20.jar:5.3.20]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.20.jar:5.3.20]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.20.jar:5.3.20]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.8.jar:2.6.8]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745) [spring-boot-2.6.8.jar:2.6.8]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420) [spring-boot-2.6.8.jar:2.6.8]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-2.6.8.jar:2.6.8]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) [spring-boot-2.6.8.jar:2.6.8]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) [spring-boot-2.6.8.jar:2.6.8]
at com.springboot.cloud.gateway.admin.GatewayAdminApplication.main(GatewayAdminApplication.java:15) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.6.8.jar:2.6.8]
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果