org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:165) ~[spring-boot-2.7.1.jar:2.7.1]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'druidConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.datasource.url' in value "${spring.datasource.url}"
我的解决办法:FIle->project structure->moudles
点击resource右键,把这个文件夹设置为配置文件目录
然后apply就可以了