exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException

原因:

Spring Boot异常org.springframework.beans.factory.NoUniqueBeanDefinitionException:没有可用的合格Bean类型:预期匹配单个Bean,但是匹配到了多个,当该bean被自动装配时与Spring Boot应用程序上下文中的两个或多个加载的Bean匹配时,就会发现该异常。

Spring Boot允许从一个接口或抽象类创建两个或多个bean。如果该bean是自动注入的,当有两个或多个bean是自动注入的时候,该bean无法自动连接,就会产生异常org.springframework.beans.factory.NoUniqueBeanDefinitionException
 

/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:59280,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Users/wangzeyu/Library/Caches/JetBrains/IntelliJIdea2020.1/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -classpath /Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar:/Users/wangzeyu/.m2/repository1/org/junit/platform/junit-platform-launcher/1.6.3/junit-platform-launcher-1.6.3.jar:/Applications/IntelliJ IDEA.app/Contents/plugins/junit/lib/junit5-rt.jar:/Applications/IntelliJ IDEA.app/Contents/plugins/junit/lib/junit-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib/tools.jar:/Users/wangzeyu/Downloads/study/project/study1/target/test-classes:/Users/wangzeyu/Downloads/study/project/study1/target/classes:/Users/wangzeyu/.m2/repository1/org/springframework/boot/spring-boot-starter/2.3.7.RELEASE/spring-boot-starter-2.3.7.RELEASE.jar:/Users/wangzeyu/.m2/repository1/org/springframework/boot/spring-boot/2.3.7.RELEASE/spring-boot-2.3.7.RELEASE.jar:/Users/wangzeyu/.m2/repository1/org/springframework/spring-context/5.2.12.RELEASE/spring-context-5.2.12.RELEASE.jar:/Users/wangzeyu/.m2/repository1/org/springframework/spring-aop/5.2.12.RELEASE/spring-aop-5.2.12.RELEASE.jar:/Users/wangzeyu/.m2/repository1/org/springframework/spring-beans/5.2.12.RELEASE/spring-beans-5.2.12.RELEASE.jar:/Users/wangzeyu/.m2/repository1/org/springframework/spring-expression/5.2.12.RELEASE/spring-expression-5.2.12.RELEASE.jar:/Users/wangzeyu/.m2/repository1/org/springframework/boot/spring-boot-autoconfigure/2.3.7.RELEASE/spring-boot-autoconfigure-2.3.7.RELEASE.jar:/Users/wangzeyu/.m2/repository1/org/springframework/boot/spring-boot-starter-logging/2.3.7.RELEASE/spring-boot-starter-logging-2.3.7.RELEASE.jar:/Users/wangzeyu/.m2/repository1/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/Users/wangzeyu/.m2/repository1/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/Users/wangzeyu/.m2/repository1/org/apache/logging/log4j/log4j-to-slf4j/2.13.3/log4j-to-slf4j-2.13.3.jar:/Users/wangzeyu/.m2/repository1/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar:/Users/wangzeyu/.m2/repository1/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar:/Users/wangzeyu/.m2/repository1/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar:/Users/wangzeyu/.m2/repository1/org/springframework/spring-core/5.2.12.RELEASE/spring-core-5.2.12.RELEASE.jar:/Users/wangzeyu/.m2/repository1/org/springframework/spring-jcl/5.2.12.RELEASE/spring-jcl-5.2.12.RELEASE.jar:/Users/wangzeyu/.m2/repository1/org/yaml/snakeyaml/1.26/snakeyaml-1.26.jar:/Users/wangzeyu/.m2/repository1/org/springframework/boot/spring-boot-starter-test/2.3.7.RELEASE/spring-boot-starter-test-2.3.7.RELEASE.jar:/Users/wangzeyu/.m2/repository1/org/springframework/boot/spring-boot-test/2.3.7.RELEASE/spring-boot-test-2.3.7.RELEASE.jar:/Users/wangzeyu/.m2/repository1/org/springframework/boot/spring-boot-test-autoconfigure/2.3.7.RELEASE/spring-boot-test-autoconfigure-2.3.7.RELEASE.jar:/Users/wangzeyu/.m2/repository1/com/jayway/jsonpath/json-path/2.4.0/json-path-2.4.0.jar:/Users/wangzeyu/.m2/repository1/net/minidev/json-smart/2.3/json-smart-2.3.jar:/Users/wangzeyu/.m2/repository1/net/minidev/accessors-smart/1.2/accessors-smart-1.2.jar:/Users/wangzeyu/.m2/repository1/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar:/Users/wangzeyu/.m2/repository1/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar:/Users/wangzeyu/.m2/repository1/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3.jar:/Users/wangzeyu/.m2/repository1/jakarta/activation/jakarta.activation-api/1.2.2/jakarta.activation-api-1.2.2.jar:/Users/wangzeyu/.m2/repository1/org/assertj/assertj-core/3.16.1/assertj-core-3.16.1.jar:/Users/wangzeyu/.m2/repository1/org/hamcrest/hamcrest/2.2/hamcrest-2.2.jar:/Users/wangzeyu/.m2/repository1/org/junit/jupiter/junit-jupiter/5.6.3/junit-jupiter-5.6.3.jar:/Users/wangzeyu/.m2/repository1/org/junit/jupiter/junit-jupiter-api/5.6.3/junit-jupiter-api-5.6.3.jar:/Users/wangzeyu/.m2/repository1/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar:/Users/wangzeyu/.m2/repository1/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar:/Users/wangzeyu/.m2/repository1/org/junit/platform/junit-platform-commons/1.6.3/junit-platform-commons-1.6.3.jar:/Users/wangzeyu/.m2/repository1/org/junit/jupiter/junit-jupiter-params/5.6.3/junit-jupiter-params-5.6.3.jar:/Users/wangzeyu/.m2/repository1/org/junit/jupiter/junit-jupiter-engine/5.6.3/junit-jupiter-engine-5.6.3.jar:/Users/wangzeyu/.m2/repository1/org/junit/platform/junit-platform-engine/1.6.3/junit-platform-engine-1.6.3.jar:/Users/wangzeyu/.m2/repository1/org/mockito/mockito-core/3.3.3/mockito-core-3.3.3.jar:/Users/wangzeyu/.m2/repository1/net/bytebuddy/byte-buddy/1.10.18/byte-buddy-1.10.18.jar:/Users/wangzeyu/.m2/repository1/net/bytebuddy/byte-buddy-agent/1.10.18/byte-buddy-agent-1.10.18.jar:/Users/wangzeyu/.m2/repository1/org/objenesis/objenesis/2.6/objenesis-2.6.jar:/Users/wangzeyu/.m2/repository1/org/mockito/mockito-junit-jupiter/3.3.3/mockito-junit-jupiter-3.3.3.jar:/Users/wangzeyu/.m2/repository1/org/skyscreamer/jsonassert/1.5.0/jsonassert-1.5.0.jar:/Users/wangzeyu/.m2/repository1/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar:/Users/wangzeyu/.m2/repository1/org/springframework/spring-test/5.2.12.RELEASE/spring-test-5.2.12.RELEASE.jar:/Users/wangzeyu/.m2/repository1/org/xmlunit/xmlunit-core/2.7.0/xmlunit-core-2.7.0.jar com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 com.example.study1.demo.DemoApplicationTests,contextLoads
Connected to the target VM, address: '127.0.0.1:59280', transport: 'socket'
22:45:46.466 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
22:45:46.493 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]
22:45:46.563 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [com.example.study1.demo.DemoApplicationTests] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]
22:45:46.601 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [com.example.study1.demo.DemoApplicationTests], using SpringBootContextLoader
22:45:46.607 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.example.study1.demo.DemoApplicationTests]: class path resource [com/example/study1/demo/DemoApplicationTests-context.xml] does not exist
22:45:46.609 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.example.study1.demo.DemoApplicationTests]: class path resource [com/example/study1/demo/DemoApplicationTestsContext.groovy] does not exist
22:45:46.609 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [com.example.study1.demo.DemoApplicationTests]: no resource found for suffixes {-context.xml, Context.groovy}.
22:45:46.611 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [com.example.study1.demo.DemoApplicationTests]: DemoApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
22:45:46.685 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [com.example.study1.demo.DemoApplicationTests]
22:45:46.827 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [/Users/wangzeyu/Downloads/study/project/study1/target/classes/com/example/study1/demo/DemoApplication.class]
22:45:46.842 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration com.example.study1.demo.DemoApplication for test class com.example.study1.demo.DemoApplicationTests
22:45:47.058 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [com.example.study1.demo.DemoApplicationTests]: using defaults.
22:45:47.059 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener]
22:45:47.068 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Skipping candidate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener] due to a missing dependency. Specify custom listener classes or make the default listener classes and their required dependencies available. Offending class: [javax/servlet/ServletContext]
22:45:47.070 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Skipping candidate TestExecutionListener [org.springframework.test.context.transaction.TransactionalTestExecutionListener] due to a missing dependency. Specify custom listener classes or make the default listener classes and their required dependencies available. Offending class: [org/springframework/transaction/TransactionDefinition]
22:45:47.071 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Skipping candidate TestExecutionListener [org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] due to a missing dependency. Specify custom listener classes or make the default listener classes and their required dependencies available. Offending class: [org/springframework/transaction/interceptor/TransactionAttribute]
22:45:47.071 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@1e8ce150, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@604f2bd2, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@1d3ac898, org.springframework.test.context.support.DirtiesContextTestExecutionListener@1b73be9f, org.springframework.test.context.event.EventPublishingTestExecutionListener@628c4ac0, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@7b84fcf8, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@30b19518, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@363042d7, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@366ac49b, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@6ad59d92, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@56f0cc85]
22:45:47.077 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: context [DefaultTestContext@447a020 testClass = DemoApplicationTests, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@7f36662c testClass = DemoApplicationTests, locations = '{}', classes = '{class com.example.study1.demo.DemoApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@52b1beb6, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@783a467b, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@537f60bf, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@298a5e20, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@5700d6b1], contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map[[empty]]], class annotated with @DirtiesContext [false] with mode [null].
22:45:47.097 [main] DEBUG org.springframework.test.context.support.DependencyInjectionTestExecutionListener - Performing dependency injection for test context [[DefaultTestContext@447a020 testClass = DemoApplicationTests, testInstance = com.example.study1.demo.DemoApplicationTests@3700ec9c, testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@7f36662c testClass = DemoApplicationTests, locations = '{}', classes = '{class com.example.study1.demo.DemoApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@52b1beb6, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@783a467b, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@537f60bf, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@298a5e20, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@5700d6b1], contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map[[empty]]]].
22:45:47.124 [main] DEBUG org.springframework.test.context.support.TestPropertySourceUtils - Adding inlined properties to environment: {spring.jmx.enabled=false, org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}.   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::        (v2.3.7.RELEASE)2022-11-01 22:45:47.696  INFO 68982 --- [           main] c.e.study1.demo.DemoApplicationTests     : Starting DemoApplicationTests on wangzeyudeMacBook-Pro.local with PID 68982 (started by wangzeyu in /Users/wangzeyu/Downloads/study/project/study1)
2022-11-01 22:45:47.700  INFO 68982 --- [           main] c.e.study1.demo.DemoApplicationTests     : No active profile set, falling back to default profiles: default
初始化InitializingBean
初始化
初始化initMethod
2022-11-01 22:45:48.673  INFO 68982 --- [           main] c.e.study1.demo.DemoApplicationTests     : Started DemoApplicationTests in 1.541 seconds (JVM running for 3.456)============================
CONDITIONS EVALUATION REPORT
============================Positive matches:
-----------------AopAutoConfiguration matched:- @ConditionalOnProperty (spring.aop.auto=true) matched (OnPropertyCondition)AopAutoConfiguration.ClassProxyingConfiguration matched:- @ConditionalOnMissingClass did not find unwanted class 'org.aspectj.weaver.Advice' (OnClassCondition)- @ConditionalOnProperty (spring.aop.proxy-target-class=true) matched (OnPropertyCondition)GenericCacheConfiguration matched:- Cache org.springframework.boot.autoconfigure.cache.GenericCacheConfiguration automatic cache type (CacheCondition)LifecycleAutoConfiguration#defaultLifecycleProcessor matched:- @ConditionalOnMissingBean (names: lifecycleProcessor; SearchStrategy: current) did not find any beans (OnBeanCondition)NoOpCacheConfiguration matched:- Cache org.springframework.boot.autoconfigure.cache.NoOpCacheConfiguration automatic cache type (CacheCondition)PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer matched:- @ConditionalOnMissingBean (types: org.springframework.context.support.PropertySourcesPlaceholderConfigurer; SearchStrategy: current) did not find any beans (OnBeanCondition)SimpleCacheConfiguration matched:- Cache org.springframework.boot.autoconfigure.cache.SimpleCacheConfiguration automatic cache type (CacheCondition)TaskExecutionAutoConfiguration matched:- @ConditionalOnClass found required class 'org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor' (OnClassCondition)TaskExecutionAutoConfiguration#applicationTaskExecutor matched:- @ConditionalOnMissingBean (types: java.util.concurrent.Executor; SearchStrategy: all) did not find any beans (OnBeanCondition)TaskExecutionAutoConfiguration#taskExecutorBuilder matched:- @ConditionalOnMissingBean (types: org.springframework.boot.task.TaskExecutorBuilder; SearchStrategy: all) did not find any beans (OnBeanCondition)TaskSchedulingAutoConfiguration matched:- @ConditionalOnClass found required class 'org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler' (OnClassCondition)TaskSchedulingAutoConfiguration#taskSchedulerBuilder matched:- @ConditionalOnMissingBean (types: org.springframework.boot.task.TaskSchedulerBuilder; SearchStrategy: all) did not find any beans (OnBeanCondition)Negative matches:
-----------------ActiveMQAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.jms.ConnectionFactory' (OnClassCondition)AopAutoConfiguration.AspectJAutoProxyingConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.aspectj.weaver.Advice' (OnClassCondition)ArtemisAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.jms.ConnectionFactory' (OnClassCondition)BatchAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.batch.core.launch.JobLauncher' (OnClassCondition)CacheAutoConfiguration:Did not match:- @ConditionalOnBean (types: org.springframework.cache.interceptor.CacheAspectSupport; SearchStrategy: all) did not find any beans of type org.springframework.cache.interceptor.CacheAspectSupport (OnBeanCondition)Matched:- @ConditionalOnClass found required class 'org.springframework.cache.CacheManager' (OnClassCondition)CacheAutoConfiguration.CacheManagerEntityManagerFactoryDependsOnPostProcessor:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean' (OnClassCondition)- Ancestor org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration did not match (ConditionEvaluationReport.AncestorsMatchedCondition)CaffeineCacheConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.github.benmanes.caffeine.cache.Caffeine' (OnClassCondition)CassandraAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.datastax.oss.driver.api.core.CqlSession' (OnClassCondition)CassandraDataAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.datastax.oss.driver.api.core.CqlSession' (OnClassCondition)CassandraReactiveDataAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.datastax.oss.driver.api.core.CqlSession' (OnClassCondition)CassandraReactiveRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.data.cassandra.ReactiveSession' (OnClassCondition)CassandraRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.datastax.oss.driver.api.core.CqlSession' (OnClassCondition)ClientHttpConnectorAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.web.reactive.function.client.WebClient' (OnClassCondition)CodecsAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.http.codec.CodecConfigurer' (OnClassCondition)CouchbaseAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.couchbase.client.java.Cluster' (OnClassCondition)CouchbaseCacheConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.couchbase.client.java.Cluster' (OnClassCondition)CouchbaseDataAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.couchbase.client.java.Bucket' (OnClassCondition)CouchbaseReactiveDataAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.couchbase.client.java.Cluster' (OnClassCondition)CouchbaseReactiveRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.couchbase.client.java.Cluster' (OnClassCondition)CouchbaseRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.couchbase.client.java.Bucket' (OnClassCondition)DataSourceAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType' (OnClassCondition)DataSourceTransactionManagerAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.jdbc.core.JdbcTemplate' (OnClassCondition)DispatcherServletAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.web.servlet.DispatcherServlet' (OnClassCondition)EhCacheCacheConfiguration:Did not match:- @ConditionalOnClass did not find required class 'net.sf.ehcache.Cache' (OnClassCondition)ElasticsearchDataAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.data.elasticsearch.core.ElasticsearchTemplate' (OnClassCondition)ElasticsearchRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.elasticsearch.client.Client' (OnClassCondition)ElasticsearchRestClientAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.elasticsearch.client.RestClient' (OnClassCondition)EmbeddedLdapAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.unboundid.ldap.listener.InMemoryDirectoryServer' (OnClassCondition)EmbeddedMongoAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.mongodb.MongoClientSettings' (OnClassCondition)EmbeddedWebServerFactoryCustomizerAutoConfiguration:Did not match:- @ConditionalOnWebApplication did not find reactive or servlet web application classes (OnWebApplicationCondition)ErrorMvcAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.servlet.Servlet' (OnClassCondition)ErrorWebFluxAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.web.reactive.config.WebFluxConfigurer' (OnClassCondition)FlywayAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.flywaydb.core.Flyway' (OnClassCondition)FreeMarkerAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'freemarker.template.Configuration' (OnClassCondition)GroovyTemplateAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'groovy.text.markup.MarkupTemplateEngine' (OnClassCondition)GsonAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.google.gson.Gson' (OnClassCondition)H2ConsoleAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.h2.server.web.WebServlet' (OnClassCondition)HazelcastAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.hazelcast.core.HazelcastInstance' (OnClassCondition)HazelcastCacheConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.hazelcast.core.HazelcastInstance' (OnClassCondition)HazelcastJpaDependencyAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.hazelcast.core.HazelcastInstance' (OnClassCondition)HibernateJpaAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.persistence.EntityManager' (OnClassCondition)HttpEncodingAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.web.filter.CharacterEncodingFilter' (OnClassCondition)HttpHandlerAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.http.server.reactive.HttpHandler' (OnClassCondition)HttpMessageConvertersAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.http.converter.HttpMessageConverter' (OnClassCondition)HypermediaAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.hateoas.EntityModel' (OnClassCondition)InfinispanCacheConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.infinispan.spring.embedded.provider.SpringEmbeddedCacheManager' (OnClassCondition)InfluxDbAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.influxdb.InfluxDB' (OnClassCondition)IntegrationAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.integration.config.EnableIntegration' (OnClassCondition)JCacheCacheConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.cache.Caching' (OnClassCondition)JacksonAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.fasterxml.jackson.databind.ObjectMapper' (OnClassCondition)JdbcRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration' (OnClassCondition)JdbcTemplateAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.jdbc.core.JdbcTemplate' (OnClassCondition)JerseyAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.servlet.ServletRegistration' (OnClassCondition)JmsAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.jms.Message' (OnClassCondition)JmxAutoConfiguration:Did not match:- @ConditionalOnProperty (spring.jmx.enabled=true) found different value in property 'enabled' (OnPropertyCondition)Matched:- @ConditionalOnClass found required class 'org.springframework.jmx.export.MBeanExporter' (OnClassCondition)JndiConnectionFactoryAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.jms.core.JmsTemplate' (OnClassCondition)JndiDataSourceAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType' (OnClassCondition)JooqAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.jooq.DSLContext' (OnClassCondition)JpaRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.data.jpa.repository.JpaRepository' (OnClassCondition)JsonbAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.json.bind.Jsonb' (OnClassCondition)JtaAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.transaction.Transaction' (OnClassCondition)KafkaAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.kafka.core.KafkaTemplate' (OnClassCondition)LdapAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.ldap.core.ContextSource' (OnClassCondition)LdapRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.data.ldap.repository.LdapRepository' (OnClassCondition)LiquibaseAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'liquibase.change.DatabaseChange' (OnClassCondition)MailSenderAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.mail.internet.MimeMessage' (OnClassCondition)MailSenderValidatorAutoConfiguration:Did not match:- @ConditionalOnSingleCandidate did not find required type 'org.springframework.mail.javamail.JavaMailSenderImpl' (OnBeanCondition)MessageSourceAutoConfiguration:Did not match:- ResourceBundle did not find bundle with basename messages (MessageSourceAutoConfiguration.ResourceBundleCondition)MongoAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.mongodb.client.MongoClient' (OnClassCondition)MongoDataAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.mongodb.client.MongoClient' (OnClassCondition)MongoReactiveAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.mongodb.reactivestreams.client.MongoClient' (OnClassCondition)MongoReactiveDataAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.mongodb.reactivestreams.client.MongoClient' (OnClassCondition)MongoReactiveRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.mongodb.reactivestreams.client.MongoClient' (OnClassCondition)MongoRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.mongodb.client.MongoClient' (OnClassCondition)MultipartAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.servlet.MultipartConfigElement' (OnClassCondition)MustacheAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.samskivert.mustache.Mustache' (OnClassCondition)Neo4jDataAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.neo4j.ogm.session.SessionFactory' (OnClassCondition)Neo4jRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.neo4j.ogm.session.Neo4jSession' (OnClassCondition)OAuth2ClientAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.security.config.annotation.web.configuration.EnableWebSecurity' (OnClassCondition)OAuth2ResourceServerAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.security.oauth2.server.resource.BearerTokenAuthenticationToken' (OnClassCondition)PersistenceExceptionTranslationAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor' (OnClassCondition)ProjectInfoAutoConfiguration#buildProperties:Did not match:- @ConditionalOnResource did not find resource '${spring.info.build.location:classpath:META-INF/build-info.properties}' (OnResourceCondition)ProjectInfoAutoConfiguration#gitProperties:Did not match:- GitResource did not find git info at classpath:git.properties (ProjectInfoAutoConfiguration.GitResourceAvailableCondition)QuartzAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.quartz.Scheduler' (OnClassCondition)R2dbcAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'io.r2dbc.spi.ConnectionFactory' (OnClassCondition)R2dbcDataAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.data.r2dbc.core.DatabaseClient' (OnClassCondition)R2dbcRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'io.r2dbc.spi.ConnectionFactory' (OnClassCondition)R2dbcTransactionManagerAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.data.r2dbc.connectionfactory.R2dbcTransactionManager' (OnClassCondition)RSocketMessagingAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'io.rsocket.RSocketFactory' (OnClassCondition)RSocketRequesterAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'io.rsocket.RSocketFactory' (OnClassCondition)RSocketSecurityAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.security.rsocket.core.SecuritySocketAcceptorInterceptor' (OnClassCondition)RSocketServerAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'io.rsocket.core.RSocketServer' (OnClassCondition)RSocketStrategiesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'io.netty.buffer.PooledByteBufAllocator' (OnClassCondition)RabbitAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.rabbitmq.client.Channel' (OnClassCondition)ReactiveElasticsearchRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsearchClient' (OnClassCondition)ReactiveElasticsearchRestClientAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'reactor.netty.http.client.HttpClient' (OnClassCondition)ReactiveOAuth2ClientAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'reactor.core.publisher.Flux' (OnClassCondition)ReactiveOAuth2ResourceServerAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity' (OnClassCondition)ReactiveSecurityAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'reactor.core.publisher.Flux' (OnClassCondition)ReactiveUserDetailsServiceAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.security.authentication.ReactiveAuthenticationManager' (OnClassCondition)ReactiveWebServerFactoryAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.http.ReactiveHttpInputMessage' (OnClassCondition)RedisAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.data.redis.core.RedisOperations' (OnClassCondition)RedisCacheConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.data.redis.connection.RedisConnectionFactory' (OnClassCondition)RedisReactiveAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'reactor.core.publisher.Flux' (OnClassCondition)RedisRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.data.redis.repository.configuration.EnableRedisRepositories' (OnClassCondition)RepositoryRestMvcAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration' (OnClassCondition)RestTemplateAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.web.client.RestTemplate' (OnClassCondition)Saml2RelyingPartyAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistrationRepository' (OnClassCondition)SecurityAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.security.authentication.DefaultAuthenticationEventPublisher' (OnClassCondition)SecurityFilterAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.security.config.http.SessionCreationPolicy' (OnClassCondition)SendGridAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'com.sendgrid.SendGrid' (OnClassCondition)ServletWebServerFactoryAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.servlet.ServletRequest' (OnClassCondition)SessionAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.session.Session' (OnClassCondition)SolrAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.apache.solr.client.solrj.impl.CloudSolrClient' (OnClassCondition)SolrRepositoriesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.apache.solr.client.solrj.SolrClient' (OnClassCondition)SpringApplicationAdminJmxAutoConfiguration:Did not match:- @ConditionalOnProperty (spring.application.admin.enabled=true) did not find property 'enabled' (OnPropertyCondition)SpringDataWebAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.data.web.PageableHandlerMethodArgumentResolver' (OnClassCondition)TaskSchedulingAutoConfiguration#taskScheduler:Did not match:- @ConditionalOnBean (names: org.springframework.context.annotation.internalScheduledAnnotationProcessor; SearchStrategy: all) did not find any beans named org.springframework.context.annotation.internalScheduledAnnotationProcessor (OnBeanCondition)ThymeleafAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.thymeleaf.spring5.SpringTemplateEngine' (OnClassCondition)TransactionAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.transaction.PlatformTransactionManager' (OnClassCondition)UserDetailsServiceAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.security.authentication.AuthenticationManager' (OnClassCondition)ValidationAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.validation.executable.ExecutableValidator' (OnClassCondition)WebClientAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.web.reactive.function.client.WebClient' (OnClassCondition)WebFluxAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.web.reactive.config.WebFluxConfigurer' (OnClassCondition)WebMvcAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.servlet.Servlet' (OnClassCondition)WebServiceTemplateAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.oxm.Marshaller' (OnClassCondition)WebServicesAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.ws.transport.http.MessageDispatcherServlet' (OnClassCondition)WebSocketMessagingAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer' (OnClassCondition)WebSocketReactiveAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.servlet.Servlet' (OnClassCondition)WebSocketServletAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.servlet.Servlet' (OnClassCondition)XADataSourceAutoConfiguration:Did not match:- @ConditionalOnClass did not find required class 'javax.transaction.TransactionManager' (OnClassCondition)Exclusions:
-----------NoneUnconditional classes:
----------------------org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfigurationorg.springframework.boot.autoconfigure.context.LifecycleAutoConfigurationorg.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfigurationorg.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfigurationorg.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration2022-11-01 22:45:48.739 ERROR 68982 --- [           main] o.s.test.context.TestContextManager      : Caught exception while allowing TestExecutionListener [org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@1d3ac898] to prepare test instance [com.example.study1.demo.DemoApplicationTests@3700ec9c]org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.example.study1.demo.DemoApplicationTests': Unsatisfied dependency expressed through field 'updateOrderService'; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.example.study1.demo.UpdateOrderService' available: expected single matching bean but found 2: updateOrderOneImpl,updateOrderTwoImplat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:392) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:119) ~[spring-test-5.2.12.RELEASE.jar:5.2.12.RELEASE]at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83) ~[spring-test-5.2.12.RELEASE.jar:5.2.12.RELEASE]at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:43) ~[spring-boot-test-autoconfigure-2.3.7.RELEASE.jar:2.3.7.RELEASE]at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:244) ~[spring-test-5.2.12.RELEASE.jar:5.2.12.RELEASE]at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:98) [spring-test-5.2.12.RELEASE.jar:5.2.12.RELEASE]at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$5(ClassBasedTestDescriptor.java:341) [junit-jupiter-engine-5.6.3.jar:5.6.3]at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:346) [junit-jupiter-engine-5.6.3.jar:5.6.3]at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$6(ClassBasedTestDescriptor.java:341) [junit-jupiter-engine-5.6.3.jar:5.6.3]at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[na:1.8.0_201]at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[na:1.8.0_201]at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[na:1.8.0_201]at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[na:1.8.0_201]at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[na:1.8.0_201]at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312) ~[na:1.8.0_201]at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743) ~[na:1.8.0_201]at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742) ~[na:1.8.0_201]at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) ~[na:1.8.0_201]at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:340) [junit-jupiter-engine-5.6.3.jar:5.6.3]at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:263) [junit-jupiter-engine-5.6.3.jar:5.6.3]at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$2(ClassBasedTestDescriptor.java:256) [junit-jupiter-engine-5.6.3.jar:5.6.3]at java.util.Optional.orElseGet(Optional.java:267) ~[na:1.8.0_201]at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$3(ClassBasedTestDescriptor.java:255) [junit-jupiter-engine-5.6.3.jar:5.6.3]at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:29) ~[junit-jupiter-engine-5.6.3.jar:5.6.3]at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:108) ~[junit-jupiter-engine-5.6.3.jar:5.6.3]at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:107) ~[junit-jupiter-engine-5.6.3.jar:5.6.3]at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:71) ~[junit-jupiter-engine-5.6.3.jar:5.6.3]at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$1(NodeTestTask.java:107) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:107) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:75) ~[junit-platform-engine-1.6.3.jar:1.6.3]at java.util.ArrayList.forEach(ArrayList.java:1257) ~[na:1.8.0_201]at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80) ~[junit-platform-engine-1.6.3.jar:1.6.3]at java.util.ArrayList.forEach(ArrayList.java:1257) ~[na:1.8.0_201]at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51) ~[junit-platform-engine-1.6.3.jar:1.6.3]at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:248) ~[junit-platform-launcher-1.6.3.jar:1.6.3]at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$5(DefaultLauncher.java:211) ~[junit-platform-launcher-1.6.3.jar:1.6.3]at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:226) ~[junit-platform-launcher-1.6.3.jar:1.6.3]at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:199) ~[junit-platform-launcher-1.6.3.jar:1.6.3]at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:132) ~[junit-platform-launcher-1.6.3.jar:1.6.3]at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:69) ~[junit5-rt.jar:na]at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) ~[junit-rt.jar:na]at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) ~[junit-rt.jar:na]at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58) ~[junit-rt.jar:na]
Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.example.study1.demo.UpdateOrderService' available: expected single matching bean but found 2: updateOrderOneImpl,updateOrderTwoImplat org.springframework.beans.factory.config.DependencyDescriptor.resolveNotUnique(DependencyDescriptor.java:220) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1285) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]... 67 common frames omitted销毁
销毁initMethod
销毁DisposableBean
Disconnected from the target VM, address: '127.0.0.1:59280', transport: 'socket'Process finished with exit code 255

代码,一个接口,有两个实现类实现了这个接口,用测试类测试报错

解决方法1

@Qualifier("实现类名称,首字母小写")

解决方法2

其中一个实现类加上@Primary注解,@Primary是指在众多相同的bean中,优先使用用@Primary注解的bean

 

 

 

 

 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/268077.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

大数据平台助力核与辐射安全监管

大数据平台助力核与辐射安全监管 核能开发利用是大国发展的战略必争之地,也是调整能源结构、应对气候变化和建设生态文明,进而确保国家安全的重要手段。虽然我国核与辐射安全监管能力不断提升,但仍面临诸多挑战。 为适应新形势和新要求&#…

SpringBoot启动项目出现Error:(3, 30) java: 程序包com.alibaba.druid.pool 程序包不存在——解决办法

运行程序报错 解决方法: mac电脑 Preference----->Build,Execution,Deployment——>maven—>Runner——>勾选Delegate IDE windows电脑 File—>Settings----->Build,Execution,Deployment——>…

bzoj4566

后缀自动机dp 一个串在另一个串上跑。 先对A建出自动机,然后用B在上面跑,记录当前匹配的最大长度,每次经过一个节点记录经过次数,并加上(len-Max(par))*Right,是这个状态对答案的贡献,然后把每个节点的出现…

WindowsPhone7入手,实在的照片

WindowsPhone7入手,实在的照片 随着Silverlight在WP7上的重要体现增加,开发技术要先行一步,不管怎么样,先开始做这方面的准备,几经周折之后,终于搞来WindowsPhone7一部,手感和体验相当不错&…

JDK动态代理和CGLIB动态代理的区别

JDK动态代理和CGLIB动态代理的区别

杂项

结巴直接分词 python -m jieba -d allTrain.txt > train_contents.txt 使用redis cmd1 :redis-server.exe redis.windows.conf cmd2:redis-cli.exe -h 127.0.0.1 -p 6379 scrapy-redis src- scrapy-redis copy- scrapy project redis keys * 列出 h…

强制使用CGLIB实现动态代理@EnableAspectJAutoProxy(proxyTargetClass = true)

用EnableAspectJAutoProxy(proxyTargetClass true)注解来开启AOP功能,基于CGLIB实现 proxyTargetClass:表示动态代理实现方式,如果值设置true,表示需要代理类都基于CGLIB来实现;默认情况下值是设置成false表示如果原…

抗击海冰 地理信息系统来帮忙

对广大生活在沿海地区的居民来讲,冬天里除了要经受大风和低温的考验外,还多了一项担忧——海冰灾害。什么是海冰?狭义来讲,是指海水结成的冰。但广义地讲,海冰是浮在海上的冰的总称,不仅包括海水冻结的冰&a…

static_cast 和 reinterpret_cast的区别以及dynamic_cast

大多程序员在学C前都学过C&#xff0c;并且习惯于C风格&#xff08;类型&#xff09;转换。当写 C&#xff08;程序&#xff09;时&#xff0c;有时候我们在使用static_cast<>和reinterpret_cast<>时可能会有点模糊。在本 文中&#xff0c;我将说明static_cast<…

@ConditionalOnProperty的作用和用法

在spring boot中有时候需要控制配置类是否生效,可以使用ConditionalOnProperty注解来控制Configuration是否生效 步骤一&#xff1a;配置类代码 Configuration ConditionalOnProperty(prefix "application", value "enable", havingValue "true&qu…

Blog-LOGO原型

上午忙里偷闲&#xff0c;特意花了一个小时&#xff0c;制作博客LOGO&#xff0c;之前一直想给博客改头换面&#xff0c;但弄了后台之后才发现&#xff0c;自定义的图片不支持本地上传&#xff0c;为了不让这一个小时的功夫浪费&#xff0c;所以贴出这张png图。想打造独特的网页…

朴素贝叶斯和贝叶斯估计

贝叶斯定理 贝叶斯定理是关于随机事件A和B的条件概率和边缘概率的一则定理。 在参数估计中可以写成下面这样&#xff1a; 这个公式也称为逆概率公式&#xff0c;可以将后验概率转化为基于似然函数和先验概率的计算表达式&#xff0c;即 在贝叶斯定理中&#xff0c;每个名词都有…

spring的service不启动事务的配置。

为什么80%的码农都做不了架构师&#xff1f;>>> 原来是这样设置的&#xff1a; <tx:attributes> <tx:method name"*" read-only"true"/> </tx:attributes> 发现selectA调用selectB&#xff0c;如果selectB抛出Exception&…

@ConditionalOnJava注解使用

如果想让配置文件在特定的jdk版本中生效可以使用ConditionalOnJava注解 等于或大于指定的jdk版本 EQUAL_OR_NEWER 小于指定的jdk版本 OLDER_THAN 步骤一&#xff1a; 我项目用的jdk8 下面的注解表示jdk版本要大于等于jdk8才生效 ConditionalOnJava(range ConditionalOnJava…

nginx实现301(加密)跳转和200跳转

我们用nginx实现301跳转&#xff0c;下面我们先讲一下实现的大概思想&#xff0c;首先我们用yum或者编译安装nginx&#xff0c;然后配置nginx的主配置文件的子文件&#xff0c;&#xff08;在配置子文件的时候可以把默认文件先注释掉&#xff09;配置好子文件之后重启nginx服务…