wcmolin opened a new issue #7553:
URL: https://github.com/apache/dolphinscheduler/issues/7553


   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   in 
https://dolphinscheduler.apache.org/en-us/development/development-environment-setup.html
   DolphinScheduler Normal Mode - Start Backend Server - Server start - 
ApiApplicationServer
   ```
   VM Options -Dlogging.config=classpath:logback-api.xml 
-Dspring.profiles.active=api. After it started
   ```
   When I refer to the documentation to configure VM options through Intellij 
IDEA and then run the program, I failed.
   ```
   [INFO] 2021-12-22 20:22:36.515 
org.apache.dolphinscheduler.api.ApiApplicationServer:[55] - Starting 
ApiApplicationServer using Java 1.8.0_131 on Mac with PID 97998 
(/Users/molin/dev/livedop/dolphinscheduler/dolphinscheduler-api/target/classes 
started by molin in /Users/molin/dev/livedop/dolphinscheduler)
   [INFO] 2021-12-22 20:22:36.534 
org.apache.dolphinscheduler.api.ApiApplicationServer:[663] - The following 
profiles are active: api
   [INFO] 2021-12-22 20:22:40.770 org.eclipse.jetty.util.log:[170] - Logging 
initialized @9594ms to org.eclipse.jetty.util.log.Slf4jLog
   [INFO] 2021-12-22 20:22:41.420 
org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory:[155] 
- Server initialized with port: 12345
   [INFO] 2021-12-22 20:22:41.425 org.eclipse.jetty.server.Server:[375] - 
jetty-9.4.44.v20210927; built: 2021-09-27T23:02:44.612Z; git: 
8da83308eeca865e495e53ef315a249d63ba9332; jvm 1.8.0_131-b11
   [INFO] 2021-12-22 20:22:41.474 
org.eclipse.jetty.server.handler.ContextHandler.application:[2347] - 
Initializing Spring embedded WebApplicationContext
   [INFO] 2021-12-22 20:22:41.474 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext:[290]
 - Root WebApplicationContext: initialization completed in 4826 ms
   [INFO] 2021-12-22 20:22:41.684 org.eclipse.jetty.server.session:[334] - 
DefaultSessionIdManager workerName=node0
   [INFO] 2021-12-22 20:22:41.685 org.eclipse.jetty.server.session:[339] - No 
SessionScavenger set, using defaults
   [INFO] 2021-12-22 20:22:41.688 org.eclipse.jetty.server.session:[132] - 
node0 Scavenging every 600000ms
   [INFO] 2021-12-22 20:22:41.698 
org.eclipse.jetty.server.handler.ContextHandler:[915] - Started 
o.s.b.w.e.j.JettyEmbeddedWebAppContext@489110c2{application,/dolphinscheduler,[file:///private/var/folders/jw/wxj0x4cx2n76tbzh7x30_vcw0000gn/T/jetty-docbase.12345.1191053625265037242/,
 
jar:file:/Users/molin/dev/applications/maven/repository/io/springfox/springfox-swagger-ui/2.9.2/springfox-swagger-ui-2.9.2.jar!/META-INF/resources,
 
jar:file:/Users/molin/dev/applications/maven/repository/com/github/xiaoymin/swagger-bootstrap-ui/1.9.3/swagger-bootstrap-ui-1.9.3.jar!/META-INF/resources],AVAILABLE}
   [INFO] 2021-12-22 20:22:41.699 org.eclipse.jetty.server.Server:[415] - 
Started @10526ms
   [WARN] 2021-12-22 20:22:41.708 
org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext:[591]
 - Exception encountered during context initialization - cancelling refresh 
attempt: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'apiApplicationServer': Injection of autowired 
dependencies failed; nested exception is java.lang.IllegalArgumentException: 
Could not resolve placeholder 'spring.datasource.driver-class-name' in value 
"${spring.datasource.driver-class-name}"
   [INFO] 2021-12-22 20:22:41.718 org.eclipse.jetty.server.session:[149] - 
node0 Stopped scavenging
   [INFO] 2021-12-22 20:22:41.721 
org.eclipse.jetty.server.handler.ContextHandler:[1153] - Stopped 
o.s.b.w.e.j.JettyEmbeddedWebAppContext@489110c2{application,/dolphinscheduler,[file:///private/var/folders/jw/wxj0x4cx2n76tbzh7x30_vcw0000gn/T/jetty-docbase.12345.1191053625265037242/,
 
jar:file:/Users/molin/dev/applications/maven/repository/io/springfox/springfox-swagger-ui/2.9.2/springfox-swagger-ui-2.9.2.jar!/META-INF/resources,
 
jar:file:/Users/molin/dev/applications/maven/repository/com/github/xiaoymin/swagger-bootstrap-ui/1.9.3/swagger-bootstrap-ui-1.9.3.jar!/META-INF/resources],STOPPED}
   [INFO] 2021-12-22 20:22:41.736 
org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener:[136]
 - 
   
   Error starting ApplicationContext. To display the conditions report re-run 
your application with 'debug' enabled.
   [ERROR] 2021-12-22 20:22:41.783 
org.springframework.boot.SpringApplication:[843] - Application run failed
   org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'apiApplicationServer': Injection of autowired dependencies failed; 
nested exception is java.lang.IllegalArgumentException: Could not resolve 
placeholder 'spring.datasource.driver-class-name' in value 
"${spring.datasource.driver-class-name}"
        at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:405)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
        at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
        at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
        at 
org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:143)
        at 
org.apache.dolphinscheduler.api.ApiApplicationServer.main(ApiApplicationServer.java:45)
   Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 
'spring.datasource.driver-class-name' in value 
"${spring.datasource.driver-class-name}"
        at 
org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:180)
        at 
org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
        at 
org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:239)
        at 
org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210)
        at 
org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:175)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:936)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1321)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300)
        at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656)
        at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639)
        at 
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
        at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
        ... 16 common frames omitted
   ```
   
   ### What you expected to happen
   
   When I change the VM Options to `-Dlogging.config=classpath:logback-api.xml
   -Dspring.profiles.active=api,mysql`, the program can start successfully. The 
same problem still exists in the description of MasterServer and WorkerServer.
   
   I think this is because the document misses mysql or other database names.
   
   ### How to reproduce
   
   refer to the documentation
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   2.0.1
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to