--- title: 'Spring Boot 常見debug 大全' disqus: hackmd --- ###### tags: `SpringBoot` Spring Boot 常見debug 大全 === [TOC] ## 筆記目的 ## 套件衝突  解決方法 可以考慮 將 pom.xml的一些版本號移除 ## 沒有掃描檔案 解決方法:加上@ComponentScan ```java= @EnableRetry @SpringBootApplication @PropertySource({"classpath:db-${spring.profiles.active}.properties"}) @ComponentScan(basePackages = { "com.allproduct.aicenter" }, excludeFilters = @Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {}) ) public class ApplicationModelCenterApplication implements ApplicationRunner { @Autowired private EmailService emailService; @Autowired private ApplicationProperties applicationProperties; ``` ## 資料庫的問題 > org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: 解法是因為有複數的資料庫,所以要加上configuration ## Target runtime Apache Tomcat v8.5 is not defined. https://blog.csdn.net/Richard1997/article/details/80665799
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up