Background
SpringBoot project needs to manually control whether to load MongoDB auto-configuration (i.e.: MongoAutoConfiguration), then startup error
- Bean method 'mongoTemplate' in 'MongoDatabaseFactoryDependentConfiguration' not loaded because @ConditionalOnBean (types: org.springframework.data.mongodb.MongoDatabaseFactory; SearchStrategy: all) did not find any beans of type org.springframework.data.mongodb.MongoDatabaseFactory
code:
@Import(value = {MongoDataAutoConfiguration.class, MongoAutoConfiguration.class})
Solution: Replace @Import content order, load MongoAutoConfiguration first
@Import(value = {MongoAutoConfiguration.class, MongoDataAutoConfiguration.class})
Read More:
- [Solved] Springboot Connect MongoDB Error: UncategorizedMongoDbException: Command failed with error 13 (Unauthorized)
- IDEA: How to Solve Springboot Project install Error
- SpringBoot startup error Failed to determine a suitable driver class
- How to Solve Springboot Error: Failed to convert value of type
- [Solved] Springboot Startup Error: Consider defining a bean of type ‘XXX’ in your configuration.
- Windows 7: How to Solve startup error: ERROR 0199
- [Solved] MongoDB Error: FaileError: dToParse: Password must be URL Encoded for mongodb:// URL:
- [Solved] mongodb Startup Error: ERROR: child process failed, exited with error number 14
- How to Solve hadoop3.x.x sh start-dfs.sh Startup Error
- [Solved] Springboot Project Startup Error: Error starting ApplicationContext
- How to Fix the common Warning Errors after Vue Project Startup
- How to Solve Error: Type mismatch: cannot convert from Object to Car
- How to Solve Error: Cannot find the declaration of element ‘beans’.
- [Solved] There are test failures. Please refer to D:\Java_study\springboot\springboot-sugon-3\target\surefire-reports for the individual test results.
- Solve the VUE startup problem (You may use special comments to disable some warnings)
- [Solved] The version of springcloud must support the current version of springboot, otherwise the startup project will report an error: error starting ApplicationContext
- [Solved] Springboot Project Startup Error: Error running XXX. Command line is too long.
- How to Solve Spring MVC upload file error
- How to Solve Nginx cross compilation Error
- How to Solve Error creating bean with name ‘log’loginController’