When starting springboot, autowired automatically injects an error,
2017-05-26 15:23:05.761 WARN 46372 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mongoTest': Unsatisfied dependency expressed through field 'mongoDaoTest'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'mongo.MongoDaoTest' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 2017-05-26 15:23:05.764 INFO 46372 --- [ main] o.apache.catalina.core.StandardService : Stopping service Tomcat 2017-05-26 15:23:05.789 INFO 46372 --- [ main] utoConfigurationReportLoggingInitializer : Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 2017-05-26 15:23:05.891 ERROR 46372 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: Field mongoDaoTest in mongo.MongoTest required a bean of type 'mongo.MongoDaoTest' that could not be found. Action: Consider defining a bean of type 'mongo.MongoDaoTest' in your configuration.
Will prompt injection failure, you can try to replace @EnableAutoConfiguration annotation with @SpringBootApplication;
@SpringBootApplication annotation effect is equivalent to @Configuration, @EnableAutoConfiguration and @ComponentScan these three annotations are used together, so do not add @EnableAutoConfiguration to the Controller
Read More:
- New Spring boot startup error Failed to auto-configure a DataSource
- [How to Fix] Spring boot startup error: could not resolve placeholder
- Spring-boot Use dubbo Error: ERROR 8404 o.s.boot.SpringApplication:Application run failed
- Two implementation methods of spring boot scan mapper interface class
- Spring boot uses configuration interface webmvcconfigurer to solve cross domain problems
- [neo4j] error report when visiting neo4j in spring boot project
- Spring Boot Druid Error: discard long time none received connection
- Causes of error in data transmission from spring boot to JSON
- [Solved] spring boot – JPA–H2 Error: H2 error: “Syntax error in SQL statement … expected identifier“
- IDEA generates Spring Boot project error: error: read timed out
- [Solved] spring boot security Start Error: ‘login.html?error‘ is not a valid redirect URL
- Error running ‘PigSellCabinetApplication’: Command line is too long. Shorten command line for PigSellCabinetApplication or also for Spring Boot default configuration
- Wildfly (JBoss) startup error: ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation (“add”) failed
- How to Fix Error when integrating spring cloud openfeign with spring cloud Alibaba
- The Ajax return value reports an error, and the spring boot development Ajax return value reports an error
- [Solved] Springcloud Add gateway to Startup Error: Exception encountered during context initialization – cancelling refresh
- SpringBoot startup error Failed to determine a suitable driver class
- SpringCloud: gateway module startup error [How to Solve]
- [Solved] renren-fast Startup Error: Error creating bean with name ‘scheduleJobController‘
- [Solved] Mycat Startup Error: ERROR Startup failed: Timed out waiting for a signal from the JVM